what’s wrong in this code? all cases fail : https://ide.codingblocks.com/s/230296
Digital Dictionary
Test case:
6
app
apple
application
batman
batmobile
cat
7
ap
bat
batcave
bat
cat
appl
appledore
Correct Output:
app
apple
application
batman
batmobile
No suggestions
batcave
batman
batmobile
cat
apple
application
No suggestions
As mentioned in the questions And if no such words are available for a given search word, add this word to your dictionary. you need to add the word which is not in the dictionary to your dictionary.
In the above example that would be ‘batcave’
still only 2 cases passed
thank you but can you tell me what I am doing wrong in my code?
In the search method pass 2 more arguments. One for prefix of the word and another for the original word. In case it’s not present add it to the dictionary