Longest Common Prefix
Write a function to find the longest common prefix string among an array of strings strs.
If there is no common prefix, return an empty string "".
Example 1
Input
strs = ["flower","flow","flight"]Output
"fl"The strings share the prefix "fl", and the next characters differ.
Example 2
Input
strs = ["dog","racecar","car"]Output
""The first characters are different, so there is no common prefix.
Constraints
- 1 <= strs.length <= 200
- 0 <= strs[i].length <= 200
- strs[i] consists of only lowercase English letters if it is non-empty