dsa1 min read
Count Distinct Substrings — Suffix Trie / Rolling Hash
Count distinct substrings. Naive: insert all suffixes into trie and count nodes. Optimal: suffix automaton or rolling hash.
Read →
webcoderspeed.com
1276 articles
Count distinct substrings. Naive: insert all suffixes into trie and count nodes. Optimal: suffix automaton or rolling hash.
Complete Tries cheatsheet: core operations, 5 patterns, binary trie for XOR, complexity table, and decision guide.
Master Two Pointers and Sliding Window patterns with 60 problems, 5-language solutions, and MAANG company tags.
Check if a string is a palindrome after removing non-alphanumeric characters using inward two pointers.
Reverse an array of characters in-place using the classic two-pointer swap technique.