LC125 Valid Palindrome asks whether a string reads the same forwards and backwards after lowercasing and dropping every non-alphanumeric character. The problem looks trivial, but it hides one bug t...
Docker Build Cache and Multi-Stage Builds: Three Mechanisms
A Docker image is not one blob — it is a stack of read-only layers, roughly one per filesystem-changing instruction (RUN, COPY, ADD). Almost every “why is my build slow / my image huge” question re...
Product of Array Except Self: Both Ends at Once
LC238 Product of Array Except Self asks for an array where each cell holds the product of every element except the one at that index — without division, in O(n). The structure that makes this trac...
Top K Frequent Elements: Why Eviction Is Safe
LC347 Top K Frequent Elements asks for the k most frequent values in an array. The real question The problem splits into two steps, and only one of them is interesting: Count how often each n...
Group Anagrams: Choosing a Canonical Key
LC49 Group Anagrams asks you to group words that are permutations of each other. The real question Grouping is trivial once you have the right key: build a dict from key to list, append, done. Th...
- 1
- 1 / 1