My code gives correct output for custom input but error when run as test


So i have used inner class in python to define TrieNode and Trie

and defined search and insert method for trie
due to some reason it runs fine for test cases in custom input and fails when same set of inputs are given in test. why is it happening?


For me it seems that in custom input there’s a trailing white space on the end of the special words string, but there isn’t one at the normal test and submit. Try checking if this is happening to you.