SOARDO
Software Engineer (SDE)dsaadvanced3 interactive MCQs in app

LCS, LIS & Subsequence Problems

subsequence vs contiguous substringLCS match vs skip recurrenceO(n log n) LIS tails + bisect_left

Longest Common Subsequence (LCS) compares prefixes of two strings: `if a[i-1] == b[j-1]: 1 + dp[i-1][j-1]`, else `max(dp[i-1][j], dp[i][j-1])` in O(m*n). Longest Increasing Subsequence (LIS) asks for strictly increasing non-contiguous elements: O(n^2) DP computes `dp[i] = 1 + max(dp[j] for j < i if nums[j] < nums[i])`, while Patience Sorting maintains `tails[len]` via binary search (`bisect_left`) in O(n log n)!

LCS of `"abcde"` and `"ace"` matches `a, c, e` diagonally (`1 + prev`) yielding length `3`; Patience LIS on `[10, 9, 2, 5]` builds `tails: [10] -> [9] -> [2] -> [2, 5]` yielding length `2`.
confusing substring/subarray (contiguous) with subsequence (can skip characters), or expecting `tails` itself to equal the actual LIS elements.
Longest Common Subsequence — GeeksforGeeksread ↗LCS, LIS & Subsequence Problems — Applied Practicepractice ↗VisuAlgo Interactive Visualizationsvisualize ↗NeetCode DSA Roadmappractice ↗

Practice LCS, LIS & Subsequence Problems with 3 graded MCQs & written feedback.

Take SOARDO’s free 12-question diagnostic to see how strong you are across your target role and unlock adaptive daily missions.

Test yourself free on SOARDO →View full Software Engineer roadmap

More Software Engineer Study Guides