At Dropbox, file path suggestions may share a common starting segment. Given an array of strings, write a function that returns the longest common prefix shared by all strings.
If there is no common prefix, return an empty string "".
strsExample 1
Input: strs = ["flower", "flow", "flight"]
Output: "fl"
Explanation: All three strings start with "fl", but not all start with "flo".
Example 2
Input: strs = ["dog", "racecar", "car"]
Output: ""
Explanation: The strings do not share any starting characters.
1 <= len(strs) <= 2000 <= len(strs[i]) <= 200strs[i] consists of English letters onlyA correct solution should compare prefixes efficiently and handle edge cases such as a single string, empty strings, or an immediate mismatch at the first character.