Sunday, November 30, 2014

Longest Common Prefix

Problem

Write a function to find the longest common prefix string amongst an array of strings.

Idea

找到最小的串,然后判断这个串的每个字符是否在其他串中的相同位置出现.

Solution


No comments:

Post a Comment