2015年4月19日
摘要: Given an arraySofnintegers, are there elementsa,b,cinSsuch thata+b+c= 0? Find all unique triplets in the array which gives the sum of zero.Note:Elemen... 阅读全文
posted @ 2015-04-19 22:31 NealCaffrey989 阅读(190) 评论(0) 推荐(0) 编辑
摘要: Write a function to find the longest common prefix string amongst an array of strings.本题寻找一组字符串的公共前缀,只需要查询较短子串前n个字符是否相等。时间:8ms代码如下:class Solution {pub... 阅读全文
posted @ 2015-04-19 22:30 NealCaffrey989 阅读(114) 评论(0) 推荐(0) 编辑