Constructs a compressed trie of all suffixes of a string in O(n) time, enabling fast substring queries.
Explain code with DocComment! Try out your own code!