09 2014 档案
摘要:Givennnon-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the histog...
阅读全文
摘要:Container With Most WaterTotal Accepted:15862Total Submissions:50802My SubmissionsGivennnon-negative integersa1,a2, ...,an, where each represents a po...
阅读全文
摘要:There areNgas stations along a circular route, where the amount of gas at stationiisgas[i].You have a car with an unlimited gas tank and it costscost[...
阅读全文
摘要:递归算法bool valid(vector &res, int r) { int nCol = res.size(); for(int i=0;i res, int &nCount) { if (l == n) { ...
阅读全文
摘要:Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the fol...
阅读全文
摘要: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 sh...
阅读全文
摘要: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...
阅读全文
摘要:bool helper(TreeNode *pA, TreeNode *pB) { if (!pA && !pB) return true; if (!pA || !pB) return false; // only one has node in a tree and...
阅读全文
摘要:Givennpairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, givenn= 3, a solution set is:"((()))...
阅读全文
摘要:Givenn, generate all structurally uniqueBST's(binary search trees) that store values 1...n.For example,Givenn= 3, your program should return all 5 uni...
阅读全文
摘要:Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given[100, 4, 200, 1, 3, 2],The longest ...
阅读全文
摘要:The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1is read off as"one 1"or11.11is read off as"tw...
阅读全文

浙公网安备 33010602011771号