• + 0 comments

    Really bad problem description.

    "the string being checked." means you maintain a set which is empty at first. Then you need to check (or process, or add) the word one by one".

    And when you found 1. the current string is a prefix any string in the set, or 2. any string in the set is a preifx of current string

    You print current string.