Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string "".
Input: strs = ["flower","flow","flight"]
Output: "fl"
Topics: strings
Asked by: Amazon, Google, Meta, Microsoft, Apple
Time complexity: O(S). Space complexity: O(1).