Browse 15 notes tagged Blind 75.
My House Robber solution, why its p1 and p2 updates work, and a clearer O(n)-time, O(1)-extra-space rolling-state version.
My Climbing Stairs path from a factorial dead end and exponential recursion to an O(n)-time, O(1)-extra-space rolling-state solution.
My Maximum Product Subarray attempt, the counterexample that broke it, and the final O(n) maximum-and-minimum state solution with an invariant and brute-force checks.
My O(n²) backward scan and final O(n) solution, with the distinction between endingHere and best, all-negative inputs, loop invariants, and executable tests.
My division-based solution and prefix/suffix version, with zero handling, loop invariants, executable tests, and the difference between extra and output space.
My progression from a global Set that loses answers to two pointers, with an explanation of all three duplicate checks, complexity, and executable assertions.
My two-pointer solution, with a brute-force comparison, a proof for discarding the shorter side, and executable checks for O(n) time and O(1) extra space.
Keep the submitted cleaned-string solution, then explain an in-place charCodeAt-based two-pointer alternative.
Keep the submitted frequency-counting sliding-window solution and explain why maxFreq can retain its historical maximum.
Keep an initial reset-and-rescan attempt, explain its O(n²) limit, then use a one-pass Map sliding window.
Work through a sorting-based Group Anagrams solution, its repeated-array-copy cost, and a count signature for the fixed lowercase alphabet.
Start with Map frequency counting and sorting, then remove the O(n log n) sort with frequency buckets.
Compare sorting, Map-based frequency differences, and a fixed-size count array for Valid Anagram, including correctness, invariants, and complexity.
Replace nested pair checks with a Map of earlier values and indices, then explain complement lookup, the loop invariant, and expected O(n) time.
Compare a Set's size with the array length, or stop early during one scan, while explaining the Set solution's correctness and expected O(n) complexity.
Google services settings
Analytics and advertising stay off until you choose.