摘要: The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integernrepresenting the total number... 阅读全文
posted @ 2014-09-24 15:15 andyqee 阅读(102) 评论(0) 推荐(0) 编辑
摘要: 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 array whic... 阅读全文
posted @ 2014-08-24 22:32 andyqee 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 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 integers.... 阅读全文
posted @ 2014-08-24 18:10 andyqee 阅读(121) 评论(0) 推荐(0) 编辑
摘要: Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't mat... 阅读全文
posted @ 2014-07-05 14:50 andyqee 阅读(92) 评论(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 @ 2014-07-03 22:24 andyqee 阅读(92) 评论(0) 推荐(0) 编辑
摘要: Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given[100, 4, 200, 1, 3, 2],The longest ... 阅读全文
posted @ 2014-07-02 22:03 andyqee 阅读(108) 评论(0) 推荐(0) 编辑
摘要: Longest Common PrefixWrite a function to find the longest common prefix string amongst an array of strings.Solution:public class Solution { public ... 阅读全文
posted @ 2014-06-28 23:04 andyqee 阅读(119) 评论(0) 推荐(0) 编辑
摘要: Longest Palindromic SubstringGiven a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there... 阅读全文
posted @ 2014-06-28 21:20 andyqee 阅读(161) 评论(0) 推荐(0) 编辑
摘要: Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:Could negative integers be palindromes? (i... 阅读全文
posted @ 2014-06-22 14:14 andyqee 阅读(145) 评论(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 @ 2014-06-22 12:56 andyqee 阅读(103) 评论(0) 推荐(0) 编辑