Problem
Given a list of strings strs, return the longest prefix shared by every string. If there is no common prefix, return the empty string "".
Example 1
- Input
- strs = ["flower", "flow", "flight"]
- Output
- "fl"
Example 2
- Input
- strs = ["dog", "racecar", "car"]
- Output
- ""
Example 3
- Input
- strs = ["alone"]
- Output
- "alone"
Constraints
1 <= strs.length <= 2000 <= strs[i].length <= 200strs[i] contains only lowercase English letters.