You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given an integer array nums, return the length of the longest strictly increasing subsequence.
6
+
7
+
A subsequence is a sequence that can be derived from an array by deleting some or no elements without changing the order of the remaining elements. For example, [3,6,2,7] is a subsequence of the array [0,3,1,6,2,2,7].
8
+
9
+
Example 1:
10
+
Input: nums = [10,9,2,5,3,7,101,18]
11
+
Output: 4
12
+
Explanation: The longest increasing subsequence is [2,3,7,101], therefore the length is 4.
13
+
14
+
Example 2:
15
+
Input: nums = [0,1,0,3,2,3]
16
+
Output: 4
17
+
18
+
Example 3:
19
+
Input: nums = [7,7,7,7,7,7,7]
20
+
Output: 1
21
+
22
+
Constraints:
23
+
1 <= nums.length <= 2500
24
+
-104 <= nums[i] <= 104
25
+
26
+
Follow up: Can you come up with an algorithm that runs in O(n log(n)) time complexity?
Copy file name to clipboardExpand all lines: Leetcode Daily Challenge/July-2021/README.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,3 +9,4 @@
9
9
| 6. |[Reduce Array Size to The Half](https://leetcode.com/explore/challenge/card/july-leetcoding-challenge-2021/608/week-1-july-1st-july-7th/3804/)|[cpp](./06.%20Reduce%20Array%20Size%20to%20The%20Half.cpp)|
10
10
| 7. |[Kth Smallest Element in a Sorted Matrix](https://leetcode.com/explore/challenge/card/july-leetcoding-challenge-2021/608/week-1-july-1st-july-7th/3805/)|[cpp](./07.%20Kth%20Smallest%20Element%20in%20a%20Sorted%20Matrix.cpp)|
11
11
| 8. |[Maximum Length of Repeated Subarray](https://leetcode.com/explore/challenge/card/july-leetcoding-challenge-2021/609/week-2-july-8th-july-14th/3807/)|[cpp](./08.%20Maximum%20Length%20of%20Repeated%20Subarray.cpp)|
0 commit comments