Problem
Problem page: https://leetcode.com/problems/longest-common-prefix/
Topics: String
Difficulty: Easy
Write a function to find the longest common prefix string amongst an array of strings.
Analysis
Pretty easy problem: find the longest common prefix of a bunch of strings. First find the longest common prefix of str1 and str2, say str1_2, then find the longest common prefix of str1_2 and str3, str1_2_3, and so on...
Code
1 | class Solution: |
Article link: https://xnerv.wang/en/leetcode-longest-common-prefix/
