Readlog: May 7, 2023

Longest Increasing Subsequence

Today, I encountered an interesting problem on LeetCode that required familiarity with the "Longest Increasing Subsequence" algorithm. Although my initial solution, which involved something similar to Monotonic Stack, was enough to pass the tests, I decided to explore the problem more deeply by requesting this subsequence for each element of the array.

David in Sunglasses (generated by DALL-E)

A demo of the approach. Source: wikimedia.org

The wiki page for Longest Increasing Subsequence - wiki may provide a more complex explanation than needed for the LeetCode problem, but it can serve as a foundation for tackling more complex problems, which I used to solve.