Given an array of strings, return the longest prefix shared by every string. Return an empty string when the list is empty or no common prefix exists.
Input / output
strs: string[]Examples
["flower", "flow", "flight"] returns "fl".["dog", "racecar", "car"] returns "".Constraints
0 <= strs.length <= 2000 <= strs[i].length <= 200Follow-up Compare horizontal scanning with sorting and a trie. Which is best when queries repeat over a fixed corpus?