摘要:
Generate ParenthesesGivennpairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, givenn= 3, a solution set is:"((()))", "(()())", "(())()", "()(())", "()()()"public class Solution { private ArrayLi 阅读全文
posted @ 2014-04-02 20:37
boole
阅读(122)
评论(0)
推荐(0)
摘要:
Plus OneGiven a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant digit is at the head of the list.public class Solution { public int[] plusOne(int[] digits) { int carry = 1; int temp; ... 阅读全文
posted @ 2014-04-02 20:14
boole
阅读(204)
评论(0)
推荐(0)
摘要:
Container With Most WaterGivennnon-negative integersa1,a2, ...,an, where each represents a point at coordinate (i,ai).nvertical lines are drawn such that the two endpoints of lineiis at (i,ai) and (i, 0). Find two lines, which together with x-axis forms a container, such that the container contains 阅读全文
posted @ 2014-04-02 19:55
boole
阅读(115)
评论(0)
推荐(0)
浙公网安备 33010602011771号