摘要: Given an arraySofnintegers, are there elementsa,b,c, anddinSsuch thata+b+c+d= target? Find all unique quadruplets in the array which gives the sum of ... 阅读全文
posted @ 2015-01-27 13:41 _Anonyme 阅读(123) 评论(0) 推荐(0) 编辑
摘要: Givennnon-negative integersa1,a2, ...,an, where each represents a point at coordinate (i,ai).nvertical lines are drawn such that the two endpoints of ... 阅读全文
posted @ 2015-01-27 13:32 _Anonyme 阅读(108) 评论(0) 推荐(0) 编辑
摘要: Implement regular expression matching with support for'.'and'*'.'.' Matches any single character.'*' Matches zero or more of the preceding element.The... 阅读全文
posted @ 2015-01-27 13:26 _Anonyme 阅读(105) 评论(0) 推荐(0) 编辑
摘要: Determine whether an integer is a palindrome. Do this without extra space.这题又是Vaguely stated。点开Spoiler,问你负数如何处理?我哪知道你怎样才判对。去discuss看看,才发现负数一律不算palindr... 阅读全文
posted @ 2015-01-14 17:11 _Anonyme 阅读(125) 评论(0) 推荐(0) 编辑
摘要: Implementatoito convert a string to an integer.Hint:Carefully consider all possible input cases. If you want a challenge, please do not see below and ... 阅读全文
posted @ 2015-01-14 16:56 _Anonyme 阅读(111) 评论(0) 推荐(0) 编辑
摘要: Reverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321逆转一个整数。题目意思很简单,但是有许多需要注意的点。例如,溢出。题目在Spoiler里面说了溢出应该返回0。但是不看Spoi... 阅读全文
posted @ 2015-01-14 16:52 _Anonyme 阅读(107) 评论(0) 推荐(0) 编辑
摘要: The string"PAYPALISHIRING"is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font fo... 阅读全文
posted @ 2015-01-14 16:46 _Anonyme 阅读(147) 评论(0) 推荐(0) 编辑
摘要: Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest pa... 阅读全文
posted @ 2015-01-14 16:36 _Anonyme 阅读(126) 评论(0) 推荐(0) 编辑
摘要: There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be ... 阅读全文
posted @ 2015-01-14 16:26 _Anonyme 阅读(88) 评论(0) 推荐(0) 编辑
摘要: Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo... 阅读全文
posted @ 2015-01-11 22:08 _Anonyme 阅读(110) 评论(0) 推荐(0) 编辑