S
All challenges
Practice
Home
Blog
Practice
Examples
Feedback
Longest Increasing Subsequence
00:00
Start
00:00
Sign in
Problem
Hints
3
Solution
History
Medium
Dynamic Programming
Binary Search
Patience Sorting
Amazon
Microsoft
Find the length of the longest strictly increasing subsequence in an array.
Examples
Example 1
Input →
[10,9,2,5,3,7,101,18]
Output →
4
Note:
2,3,7,101 or 2,5,7,101
Example 2
Input →
[0,1,0,3,2,3]
Output →
4
Note:
0,1,2,3
Example 3
Input →
[7,7,7,7]
Output →
1
JavaScript
Python
Java (Coming soon)
C (Coming soon)
C++ (Coming soon)
Reset
Run
Submit
Cases
Results