摘要:
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:"((()))", "(()())", "(())()", "()(())", "()()()" 1 public static List<string> GenerateParentheses 阅读全文
摘要:
Given an unsorted integer array, find the first missing positive integer.For example,Given [1,2,0] return 3,and [3,4,-1,1] return 2.Your algorithm should run in O(n) time and uses constant space.JAVA 正解如下: 1 public class Solution { 2 public int firstMissingPositive(int[] A) { 3 // Start ... 阅读全文