Find the length of the longest strictly increasing subsequence. Elements don't need to be contiguous.
DP: dp[i] = length of LIS ending at index i. For each i, check all j < i where nums[j] < nums[i]. O(n²) solution.
💡 Pro tip: Understand this problem deeply — don't just memorize the code. Try explaining the approach out loud as if teaching a friend. If you can explain it simply, you truly understand it!
lengthOfLIS([10, 9, 2, 5, 3, 7, 101, 18])
4