Given an array of strings strs, return the longest string that is a prefix of every one of them. If they don't share a prefix, return an empty string.
Examples
Example 1
- Input
- strs = ["flower", "flow", "flight"]
- Output
- "fl"
Example 2
- Input
- strs = ["dog", "racecar", "car"]
- Output
- ""
- Why
- The words don't share a first letter.
Constraints
1 <= strs.length <= 2000 <= strs[i].length <= 200- Strings contain only lowercase English letters.