Longest Common Prefix
摘要:
Write a function to find the longest common prefix string amongst an array of strings.思路:先求前两个字符串的公共前缀,然后拿这个前缀和其他字符串进行比对。 1 int min(int a, int b){ 2 if(a &strs) { 7 // Note: The Solution object is instantiated only once and is reused by each test case. 8 int n = strs.siz... 阅读全文
posted @ 2013-10-10 20:29 waruzhi 阅读(169) 评论(0) 推荐(0) 编辑