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
1 articles
Count distinct substrings. Naive: insert all suffixes into trie and count nodes. Optimal: suffix automaton or rolling hash.