2015年2月24日

LeetCode-134 Gas Station

摘要: 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 @ 2015-02-24 00:23 linxiong1991 阅读(115) 评论(0) 推荐(0) 编辑

2015年2月22日

LeetCode-39 Combination Sum

摘要: Given a set of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT.Thesamerepeated num... 阅读全文

posted @ 2015-02-22 12:18 linxiong1991 阅读(106) 评论(0) 推荐(0) 编辑

2015年2月20日

LeetCode-55 Jump Game

摘要: Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximu... 阅读全文

posted @ 2015-02-20 17:10 linxiong1991 阅读(154) 评论(0) 推荐(0) 编辑

2015年2月19日

LeetCode-90 Subsets II

摘要: Given a collection of integers that might contain duplicates,S, return all possible subsets.Note:Elements in a subset must be in non-descending order.... 阅读全文

posted @ 2015-02-19 19:52 linxiong1991 阅读(94) 评论(0) 推荐(0) 编辑

2015年2月18日

LeetCode-78 Subsets

摘要: Given a set of distinct integers,S, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set must not co... 阅读全文

posted @ 2015-02-18 00:21 linxiong1991 阅读(116) 评论(0) 推荐(0) 编辑

2015年2月17日

LeetCode-42 Trapping Rain Water

摘要: Givennnon-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.Fo... 阅读全文

posted @ 2015-02-17 02:04 linxiong1991 阅读(113) 评论(0) 推荐(0) 编辑

2015年2月16日

LeetCode-73 Set Matrix Zeroes

摘要: Given amxnmatrix, if an element is 0, set its entire row and column to 0. Do it in place.click to show follow up.Follow up:Did you use extra space?A s... 阅读全文

posted @ 2015-02-16 18:18 linxiong1991 阅读(98) 评论(0) 推荐(0) 编辑

2015年2月15日

LeetCode-48 Rotate Image

摘要: You are given annxn2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this in-place?思路1:新建一个新的二维矩阵,原矩阵按... 阅读全文

posted @ 2015-02-15 18:28 linxiong1991 阅读(115) 评论(0) 推荐(0) 编辑

2015年2月14日

LeetCode-22 Generate Parentheses

摘要: Givennpairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, givenn= 3, a solution set is:"((()))... 阅读全文

posted @ 2015-02-14 01:18 linxiong1991 阅读(117) 评论(0) 推荐(0) 编辑

2015年2月12日

LeetCode-53 Maximum Subarray

摘要: Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [−2,1,−3,4,−1,2,1... 阅读全文

posted @ 2015-02-12 19:13 linxiong1991 阅读(109) 评论(0) 推荐(0) 编辑

导航