摘要: Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. Given n = 3, a solution set is: "((()))", "(() 阅读全文
posted @ 2016-03-21 08:21 哥布林工程师 阅读(122) 评论(0) 推荐(0) 编辑
摘要: There are N gas stations along a circular route, where the amount of gas at station i is gas[i]. You have a car with an unlimited gas tank and it cost 阅读全文
posted @ 2016-03-21 08:09 哥布林工程师 阅读(171) 评论(0) 推荐(0) 编辑
摘要: Given an unsorted integer array, find the first missing positive integer. Given [1,2,0] return 3,and [3,4,-1,1] return 2. 思路: 通过在数组进行的交换,把A[i]赋值为i + 1 阅读全文
posted @ 2016-03-21 07:57 哥布林工程师 阅读(142) 评论(0) 推荐(0) 编辑
摘要: The code base version is an integer start from 1 to n. One day, someone committed a bad version in the code case, so it caused this version and the fo 阅读全文
posted @ 2016-03-21 07:23 哥布林工程师 阅读(108) 评论(0) 推荐(0) 编辑
摘要: Given an array contains N numbers of 0 .. N, find which number doesn't exist in the array. Given N = 3 and the array [0, 1, 3], return 2. 阅读全文
posted @ 2016-03-21 07:20 哥布林工程师 阅读(122) 评论(0) 推荐(0) 编辑
摘要: There is an integer array which has the following features: We define a position P is a peek if: Find a peak element in this array. Return the index o 阅读全文
posted @ 2016-03-21 07:16 哥布林工程师 阅读(136) 评论(0) 推荐(0) 编辑