No Prefix Set

  • + 0 comments

    Hint: use a data structure like a trie (a prefix tree) since the alphabet is a fixed size.

    You should be able to detect during insertion whether the current word is a prefix of a word already in the data structure, or whether there are any other words which have the current word as a prefix.