human
Solve in Python:
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 "".

Example 1:

Input: ["flower","flow","flight"]
Output: "fl"

Example 2:

Input: ["dog","racecar","car"]
Output: ""
Explanation: There is no common prefix among the input strings.

Note:

All given inputs are in lowercase letters a-z.

=====
Can you provide a Python program to find the longest common prefix string amongst an array of strings?
assistant
#Here is Python program to find the longest common prefix string amongst an array of strings.

class Solution:
     def _longestCommonPrefix(self, left, right):
         prefix = ''
         i = j = 0
         while(i < len(left) and j < len(right)):
             if left[i] == right[j]:
                 prefix += left[i]
             else:
                 break
             i += 1
             j += 1
         return prefix
     
     def longestCommonPrefix(self, strs):
         """
         :type strs: List[str]
         :rtype: str
         """
         if not strs:
           return ''
         elif len(strs) == 1:
           return strs[0]
         mid = len(strs)//2
         left, right = self.longestCommonPrefix(strs[mid:]), self.longestCommonPrefix(strs[:mid])
         return self._longestCommonPrefix(left, right)