• + 1 comment

    This problem is very frustrating and unclear. If I understood it correctly, it asks the following:

    For each word w, check if any other word in the array is a prefix of w. If yes, print 'BAD SET' followed by w on the next line and stop the execution. If no prefix was found for any of the words in the list, print 'GOOD SET'.

    However, there's one example in which my code fails that says the expected result is 'BAD SET d', even though there's no other 'd' in the words list, which would be the only way to make the expected result correct. Only the word itself can be its prefix if its length is equal to one.