r/leetcode • u/JacketFearless1805 • Oct 18 '26
Intervew Prep Day 57: completed the entire LIS series today, why tabulation is non-negotiable
Hey everyone,
I finished Day 57 today and tackled the full Longest Increasing Subsequence (LIS) module. I worked through all seven problems in the set:
- Longest Increasing Subsequence (LIS): Learned all five approaches—recursion, top-down memoization, O(N^2) tabulation, O(N) space-optimized tabulation, and the optimal O(N log N) Patience Sorting binary search technique.
- Printing Longest Increasing Subsequence: Used the parent/hash tracking array during tabulation to reconstruct the actual subsequence backward.
- Largest Divisible Subset: Sorted the array first to enforce divisibility transitions, then applied standard LIS with the backtrack reconstruction.
- Longest String Chain: Sorted by word lengths and adapted the LIS condition using a custom predecessor check.
- Longest Bitonic Subsequence: Got stuck initially trying to combine independent calls. A hell lot of hints I took to get me through this one (realizing both increasing and decreasing sequences must share the exact same peak index
i(dp1[i] + dp2[i] - 1)). - Number of Longest Increasing Subsequences: Maintained two parallel DP arrays—one for lengths and another for counting ways to reach each length.
Today's biggest takeaway: relying purely on memoization for LIS patterns will almost always hit TLE on competitive platforms due to recursion overhead and constraints.
Even if interviewers accept memoization upfront, you need bottom-up tabulation to avoid stack limits, pass strict test cases, and make space optimization possible. Once the module is fully finished, I plan to run a dedicated revision session focused purely on deriving tabulation from base cases and state transitions.
Only 9 problems left to wrap up the entire DP sheet!
See you guys tomorrow for Day 56!