I'm trying to solve this 1200E - Compress Words using Suffix Tree. My approach is, for each word, traverse the tree from the root according to that word's letters, and for each letter I need to check whether I've reached a suffix or not, while still allowing further appending to the suffix tree.
So, is there any tweaks I can do to make this work?