02 2015 档案

摘要:题目描述:Given an arraySofnintegers, are there elementsa,b,c, anddinSsuch thata+b+c+d= target? Find all unique quadruplets in the array which gives the su... 阅读全文
posted @ 2015-02-11 10:15 Sawyer Ford 阅读(129) 评论(0) 推荐(0)
摘要:题目描述:Given an arraySofnintegers, find three integers inSsuch that the sum is closest to a given number, target.Return the sum of the three integers.Yo... 阅读全文
posted @ 2015-02-10 18:46 Sawyer Ford 阅读(145) 评论(0) 推荐(0)
摘要:题目描述: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:E... 阅读全文
posted @ 2015-02-09 14:53 Sawyer Ford 阅读(193) 评论(0) 推荐(0)
摘要:题目描述:Write a function to find the longest common prefix string amongst an array of strings. 题目很唬人,搞清楚前缀的意思就简单了。解题思路就四个字:垂直匹配。solution:string longestC... 阅读全文
posted @ 2015-02-08 11:23 Sawyer Ford 阅读(145) 评论(0) 推荐(0)
摘要:题目描述:Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999. 这道题很简单,我就直接贴答案了。solution1:int romanTo... 阅读全文
posted @ 2015-02-06 21:37 Sawyer Ford 阅读(173) 评论(0) 推荐(0)
摘要:题目描述:Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999. 这道题我必须炫一下,因为提交一次就成功了,而且代码很赞。solution:... 阅读全文
posted @ 2015-02-06 08:50 Sawyer Ford 阅读(156) 评论(0) 推荐(0)
摘要:题目描述:Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two ... 阅读全文
posted @ 2015-02-05 10:37 Sawyer Ford 阅读(146) 评论(0) 推荐(0)
摘要:题目描述:Implement regular expression matching with support for'.'and'*'.'.' Matches any single character.'*' Matches zero or more of the preceding elemen... 阅读全文
posted @ 2015-02-02 10:36 Sawyer Ford 阅读(148) 评论(0) 推荐(0)