Compiling correctly and giving correct output but test cases giving run error.
DigitalDictionary
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 and print No suggestions.
When printing “No suggestions” your code gives a Null pointer exception.
The first three test cases are still failing.
@Rishabh8488,
https://ide.codingblocks.com/s/281125 corrected code.
Use an arraylist to store the words and while searching use an arraylist