2014年10月16日
摘要: Problem: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.Not... 阅读全文
posted @ 2014-10-16 22:41 higerzhang 阅读(306) 评论(0) 推荐(0) 编辑
摘要: Problems:Write a function to find the longest common prefix string amongst an array of strings.就是返回一个字符串数组的所有的公共前缀。不难。我是已第一个字符串为参考,然后依次遍历其他的字符串,一旦遇到不同... 阅读全文
posted @ 2014-10-16 00:07 higerzhang 阅读(189) 评论(0) 推荐(0) 编辑
摘要: Problem:Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.遍历一次输入的字符串,如果不满足类似4或者9的就直接加相应的数,否则减去... 阅读全文
posted @ 2014-10-16 00:00 higerzhang 阅读(208) 评论(0) 推荐(0) 编辑