3d ago · 4 min read · Sliding Window Technique When solving array or string problems in competitive programming, we often deal with subarrays or substrings. A naive solution usually checks every possible subarray, which le
Join discussion
Mar 9 · 15 min read · TLDR TLDR: An Inverted Index maps every word to the list of documents containing it — the same structure as the back-of-the-book index. It is the core data structure behind every full-text search engine, including Elasticsearch, Lucene, and PostgreS...
Join discussionMar 9 · 12 min read · TLDR: A hash table gives you near-O(1) lookups, inserts, and deletes by using a hash function to map keys to array indices. The tradeoff: collisions (when two keys hash to the same slot) must be handled, and a full hash table must be resized. 📖 Th...
Join discussionMar 9 · 13 min read · TLDR: Backtracking is "Recursion with Undo." You try a path, explore it deeply, and if it fails, you undo your last decision and try the next option. It explores the full search space but prunes invalid branches early, making it far more efficient th...
Join discussion