摘要: 问题:求是否给定的数列为一个山形数列(先单调增,再单调减) Example 1: Input: [2,1] Output: false Example 2: Input: [3,5,5] Output: false Example 3: Input: [0,3,2,1] Output: true N 阅读全文
posted @ 2020-03-29 16:15 habibah_chang 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 问题: 求一个数列中的,最大嵌套子数列长度 Example 1: Input: A = [5,4,0,3,1,6,2] Output: 4 Explanation: A[0] = 5, A[1] = 4, A[2] = 0, A[3] = 3, A[4] = 1, A[5] = 6, A[6] = 阅读全文
posted @ 2020-03-29 15:37 habibah_chang 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 问题: 求未排序数列中,最长连续数列长度。 Example: Input: [100, 4, 200, 1, 3, 2] Output: 4 Explanation: The longest consecutive elements sequence is [1, 2, 3, 4]. Therefo 阅读全文
posted @ 2020-03-29 14:50 habibah_chang 阅读(110) 评论(0) 推荐(0) 编辑