摘要: Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.For "(()", the lon... 阅读全文
posted @ 2014-11-21 12:27 LiBlog 阅读(163) 评论(0) 推荐(0)
摘要: Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).You are given a target valu... 阅读全文
posted @ 2014-11-21 11:27 LiBlog 阅读(173) 评论(0) 推荐(0)
摘要: Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:"((... 阅读全文
posted @ 2014-11-21 05:41 LiBlog 阅读(178) 评论(0) 推荐(0)
摘要: Given a linked list, swap every two adjacent nodes and return its head. For example,Given 1->2->3->4, you should return the list as 2->1->4->3.Your al... 阅读全文
posted @ 2014-11-21 05:23 LiBlog 阅读(133) 评论(0) 推荐(0)
摘要: Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in the ord... 阅读全文
posted @ 2014-11-21 05:06 LiBlog 阅读(116) 评论(0) 推荐(0)
摘要: Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.Each numb... 阅读全文
posted @ 2014-11-21 04:40 LiBlog 阅读(170) 评论(0) 推荐(0)
摘要: Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.The same repeate... 阅读全文
posted @ 2014-11-21 04:04 LiBlog 阅读(168) 评论(0) 推荐(0)
摘要: Given two numbers represented as strings, return multiplication of the numbers as a string. Note: The numbers can be arbitrarily large and are non-neg 阅读全文
posted @ 2014-11-21 03:22 LiBlog 阅读(172) 评论(0) 推荐(0)
摘要: Given a collection of numbers, return all possible permutations. For example,[1,2,3] have the following permutations:[1,2,3], [1,3,2], [2,1,3], [2,3,1... 阅读全文
posted @ 2014-11-21 00:53 LiBlog 阅读(138) 评论(0) 推荐(0)