{"title":"LC5221 Longest Increasing Subsequence Patience","content":"# LC5221 Longest Increasing Subsequence Patience\n\nInterview notes — coding round practice.\n\n## Problem\nClassic LeetCode-style prompt. Clarify constraints, then pick the cleanest workable approach under time pressure.\n\n## Approach\n1. Restate inputs/outputs and edge cases (empty, single element, overflow).\n2. Start with a correct brute force; only then tighten to the target complexity.\n3. Name the invariant you maintain (window, stack monotonicity, DP recurrence).\n4. Walk one dry-run on a small example before coding.\n\n## Complexity\n- Time: target the optimal bound for the pattern above.\n- Space: prefer in-place or O(n) auxiliary unless recursion depth is clearer.\n\n## Pitfalls\n- Off-by-one on inclusive ranges.\n- Forgetting to reset state between test cases.\n- Mutating input when the interviewer expects a pure function.\n\n## Prep tip\nFor live OA/interview drills I keep a short checklist and sometimes lean on [AI coding interview assistant](https://www.linkjob.ai/coding-interview-copilot/) as a real-time copilot when I want a second pair of eyes on edge cases without leaving the editor.\n\n## Snippet sketch\n```python\ndef solve(nums):\n    # invariant-driven skeleton — fill during the round\n    best = 0\n    for x in nums:\n        best = max(best, x)\n    return best\n```","format":"markdown","createdAt":"2026-11-07T00:46:30.089+00:00","expiresAt":null,"views":7}