摘要: Problem:Given an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the".解法一:全局翻转 局部翻转 核心代码 vo... 阅读全文
posted @ 2015-06-05 22:06 尾巴草 阅读(137) 评论(0) 推荐(0) 编辑
摘要: problem:Validate if a given string is numeric.Some examples:"0"=>true" 0.1 "=>true"abc"=>false"1 a"=>false"2e10"=>trueNote:It is intended for the prob... 阅读全文
posted @ 2015-06-05 20:41 尾巴草 阅读(193) 评论(0) 推荐(0) 编辑
摘要: Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: Pana... 阅读全文
posted @ 2015-06-05 19:38 尾巴草 阅读(156) 评论(0) 推荐(0) 编辑
摘要: probelms:Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three ... 阅读全文
posted @ 2015-06-05 10:20 尾巴草 阅读(150) 评论(0) 推荐(0) 编辑
摘要: problems:Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the a... 阅读全文
posted @ 2015-06-05 09:56 尾巴草 阅读(149) 评论(0) 推荐(0) 编辑