17. Shared Prefix
easystring
Return the longest string that is a prefix of every word in words. Return an empty string if there is none.
Example 1
Inputwords = ["flower","flow","flight"]
Output"fl"
Example 2
Inputwords = ["dog","racecar","car"]
Output""
Constraints
- 1 ≤ words.length ≤ 200
- 0 ≤ words[i].length ≤ 200