Longest Prefix Matching - A Trie Based Solution in Java
Given a dictionary of words and an input string, we need to find the longest prefix of the string that is also a word in the dictionary.Examples: Let the dictionary contain the following words:{are, area, base, cat, cater, children, basement}Below are the sample input/output:Input String Outputcater