Weikoi

导航

2020年3月5日 #

Leetcode-014-最长公共前缀

摘要: 本题比较简单,遍历就好,o(M*N)时间复杂度,遍历终止的条件是长度到头或者某一位字符互不相等。 class Solution { public String longestCommonPrefix(String[] strs) { if(strs.length==0)return ""; for( 阅读全文

posted @ 2020-03-05 15:11 Weikoi 阅读(91) 评论(0) 推荐(0) 编辑