首页 > 其他 > 详细

[LintCode] Longest Increasing Continuous Subsequence 最长连续递增子序列

时间:2016-09-09 22:08:47      阅读:200      评论:0      收藏:0      [点我收藏+]

 

Give an integer array,find the longest increasing continuous subsequence in this array.

An increasing continuous subsequence:

  • Can be from right to left or from left to right.
  • Indices of the integers in the subsequence should be continuous.
 Notice

O(n) time and O(1) extra space.

Example

For [5, 4, 2, 1, 3], the LICS is [5, 4, 2, 1], return 4.

For [5, 1, 2, 3, 4], the LICS is [1, 2, 3, 4], return 4.

 

[LintCode] Longest Increasing Continuous Subsequence 最长连续递增子序列

原文:http://www.cnblogs.com/grandyang/p/5858125.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!