

To insert a string WORD in the Trie, we use ‘’Type 1’’ query.
Example: 1 WORD
We will put the integer 1 before the input string WORD to insert it into the Trie.
To delete the string WORD from the Trie, we use the “Type 2” query.
Example: 2 WORD
We will put integer 2 before the input string WORD to delete the string WORD from the Trie.
Query A - 1 coding
This query will add the string “coding” in the trie.
Query B - 2 coding
This query will delete the string “coding” from the Trie. After deleting the string, it will produce “TRUE” as it’s output.
If anywhere in the output, the word “FALSE” is printed, it means that the given string is not deleted successfully from the Trie, and hence it will lead to a Wrong Answer.
The first line of input contains an integer 'Q' representing the number of queries. Then the 'Q' queries follow.
The first and the only line of each query contains an integer ‘T’ denoting the type of query and a string 'WORD' denoting the query string both separated by a single space
For each query of Type 2 print "TRUE" if the string WORD is deleted from the Trie or "FALSE" if it is not deleted.
You don’t have to print anything, it has already been taken care of. Just implement the given function.
1 <= 'Q' <= 10000
1 <= 'T' <= 2
1 <= |WORD| <= 20
Where |WORD| is the length of the input string
Each input string 'WORD' will consist of lower case alphabets (a-z) only.
Time limit: 1 second
We are given a function deleteWord which takes the root node of input Trie ROOT and a string WORD as parameters.
Complete String
Complete String
Complete String
Complete String
Complete String
Complete String
Similar Name
Similar Name
Similar Name
Similar Name
Auto Suggestion
Auto Suggestion
Auto Suggestion
Auto Suggestion
Auto Suggestion
Auto Suggestion
Palindrome Pairs
Design Search Autocomplete System
Design Search Autocomplete System
Design Search Autocomplete System
Design Search Autocomplete System
Design Search Autocomplete System
Design Search Autocomplete System