Longest Common Prefix
Given a list of lowercase alphabet strings words
, return the longest common prefix.
https://binarysearch.com/problems/Longest-Common-Prefix
Examples
Example 1
Input
- words =
['anthony', 'ant', 'antigravity']
Output
- answer =
ant
Explanation
"ant"
is the longest common prefix between the three strings.
Leave a comment