Home
Topics
Practice
Roadmap
DSA Tracker
Code Editor
Tech Blogs
More
Sign in
Get started
Loading question...
Feedback
Longest Increasing Subsequence
Medium
00:00
0 users online
Share
Description
Solution
Submissions
Discussion
Given an array, find the length of the longest strictly increasing subsequence.
Sample Input:
[10,9,2,5,3,7,101,18]
Sample Output:
4
Hints
Hint 1
Use patience sorting algorithm with binary search
Hint 2
Maintain tails array where tails[i] is smallest tail of LIS length i+1
Hint 3
For each number, find position in tails using binary search
Code Editor
Reset
Run
Save
Loading...