-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path300.最长递增子序列.js
72 lines (69 loc) · 1.25 KB
/
300.最长递增子序列.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
* @lc app=leetcode.cn id=300 lang=javascript
*
* [300] 最长递增子序列
*
* https://leetcode-cn.com/problems/longest-increasing-subsequence/description/
*
* algorithms
* Medium (52.55%)
* Likes: 2415
* Dislikes: 0
* Total Accepted: 491.3K
* Total Submissions: 923.8K
* Testcase Example: '[10,9,2,5,3,7,101,18]'
*
* 给你一个整数数组 nums ,找到其中最长严格递增子序列的长度。
*
* 子序列 是由数组派生而来的序列,删除(或不删除)数组中的元素而不改变其余元素的顺序。例如,[3,6,2,7] 是数组 [0,3,1,6,2,2,7]
* 的子序列。
*
*
* 示例 1:
*
*
* 输入:nums = [10,9,2,5,3,7,101,18]
* 输出:4
* 解释:最长递增子序列是 [2,3,7,101],因此长度为 4 。
*
*
* 示例 2:
*
*
* 输入:nums = [0,1,0,3,2,3]
* 输出:4
*
*
* 示例 3:
*
*
* 输入:nums = [7,7,7,7,7,7,7]
* 输出:1
*
*
*
*
* 提示:
*
*
* 1 <= nums.length <= 2500
* -10^4 <= nums[i] <= 10^4
*
*
*
*
* 进阶:
*
*
* 你能将算法的时间复杂度降低到 O(n log(n)) 吗?
*
*
*/
// @lc code=start
/**
* @param {number[]} nums
* @return {number}
*/
var lengthOfLIS = function(nums) {
};
// @lc code=end