package leetcode; import java.util.ArrayList; import java.util.List; class TrieNode{ Boolean isWord;//true if path till this node represent a string. Integer freq;//numbers of strings share the same prefix Character nodeChar;//character for this node…
14. Longest Common Prefix Easy Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string "". Example 1: Input: ["flower","flow","flight&qu…