摘要: Givennpairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, givenn= 3, a solution set is:"((()))... 阅读全文
posted @ 2015-10-12 23:36 amazingzoe 阅读(180) 评论(0) 推荐(0)
摘要: Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e.,0 1 2 4 5 6 7might become4 5 6 7 0 1 2).Find the minimum element.You m... 阅读全文
posted @ 2015-10-12 09:38 amazingzoe 阅读(106) 评论(0) 推荐(0)
摘要: Given an array of numbersnums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements t... 阅读全文
posted @ 2015-10-12 07:40 amazingzoe 阅读(139) 评论(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-10-12 07:04 amazingzoe 阅读(152) 评论(0) 推荐(0)
摘要: Givennpoints on a 2D plane, find the maximum number of points that lie on the same straight line.Runtime: 40ms 1 /** 2 * Definition for a point. 3 *... 阅读全文
posted @ 2015-10-12 06:03 amazingzoe 阅读(150) 评论(0) 推荐(0)
摘要: Divide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT.Runtime: 8ms 1 class Solution { 2 public... 阅读全文
posted @ 2015-10-12 00:38 amazingzoe 阅读(134) 评论(0) 推荐(0)