+ 1

Can anyone help me to solve the challenge I'm getting some error and can't able to decode that?

Here is the challenge code which I've tried https://www.sololearn.com/post/241300/?ref=app https://code.sololearn.com/csprLkXF0VVF/?ref=app

11th Feb 2020, 8:36 PM
Preity - avatar
2 Answers
+ 5
The first strange thing in your code i notice is : root = Trie() You're creating the same object multiple times in a loop with no reason. Then, you're not using the class methods the proper way: insert(root, word) should be: root.insert(word) and similarly, find(root, query) should be : root.find(query)
11th Feb 2020, 9:36 PM
Cépagrave - avatar
+ 5
I am confused, why are you using a class? Also, you are using class methods without even defining an object... why not use function to make it easier?
11th Feb 2020, 9:04 PM
Aymane Boukrouh
Aymane Boukrouh - avatar