- 博客(9)
- 资源 (3)
- 收藏
- 关注
原创 [leetcode]Permutations
Given a collection of numbers, return all possible permutations. For example, [1,2,3] have the following permutations: [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], and [3,2,1]. 全排列问题,本题不考虑重复
2014-04-02 10:49:11
310
原创 [leetcode]Jump Game II
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 maximum jump length at that position. Your goal i
2014-03-31 10:54:24
328
原创 [leetcode]Rain Water
Given n non-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. For example, Given [0,1,0,2,1,0,1,3,2,1,2,1]
2014-03-06 10:49:46
371
原创 [leetcode]First Missing Positive
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 spa
2014-03-05 11:11:33
425
原创 [leetcode]Count and Say
The count-and-say sequence is the sequence of integers beginning as follows: 1, 11, 21, 1211, 111221, ... 1 is read off as "one 1" or 11. 11 is read off as "two 1s" or 21. 21 is read off as "on
2014-02-28 10:13:20
408
原创 [leetcode]Sudoku Solver
Sudoku Solver Total Accepted: 4129 Total Submissions: 20589My Submissions Write a program to solve a Sudoku puzzle by filling the empty cells. Empty cells are indicated by the character
2014-02-27 09:45:29
547
原创 [leetcode]Valid Sudoku
Valid Sudoku Total Accepted: 4716 Total Submissions: 17442 My Submissions Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules. The Sudoku board could be partially f
2014-02-25 11:01:12
508
原创 [leetcode]Search Insert Position
用二分查找的思想 注意最后返回的left right 会出错 class Solution { public: int searchInsert(int A[], int n, int target) { int left=0; int right=n-1; while(left<=right){ int mid=
2014-02-24 10:14:56
434
原创 [leetcode] Search for a Range
Given a sorted array of integers, find the starting and ending position of a given target value. Your algorithm's runtime complexity must be in the order of O(log n). If the target is not found
2014-02-21 10:15:27
367
dash for mac 2.1.2 破解版
2014-07-11
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人