300. Longest Increasing Subsequence

Practice Longest Increasing Subsequence for free on NudgeCode: Medium, Dynamic Programming pattern. Write it in Python or JavaScript, run the tests in your browser, and ask for a hint when you are stuck.

Return the length of the longest strictly increasing subsequence of nums. A subsequence keeps the original order but may skip elements.

Example

nums = [10,9,2,5,3,7,101,18]  ->  4   (for example [2,3,7,101])
nums = [7,7,7,7]              ->  1

Constraints