pyassistant

Longest Common Prefix

Given a list of strings, 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:

Input:
['flower', 'flow', 'flight', 'flee']
Output:
'fl'

Make sure you return your solution, don't print!

AI

Bot

Trying to solve my challenge? Ask if you must, or press the purple button so I can analyze your code.