Longest Increasing Subsequence

00:00
MediumDynamic ProgrammingBinary SearchPatience Sorting
AmazonMicrosoft

Find the length of the longest strictly increasing subsequence in an array.

Examples

Input → [10,9,2,5,3,7,101,18]
Output → 4
Explanation:

2,3,7,101 or 2,5,7,101

Input → [0,1,0,3,2,3]
Output → 4
Explanation:

0,1,2,3

Input → [7,7,7,7]
Output → 1