最新 最热

Leetcode 41 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 shou...

2018-01-12
1

Leetcode 59 Spiral Matrix II

Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order. For example, Given n = 3,You should return the following mat...

2018-01-12
1

Leetcode 60 Permutation Sequence

The set [1,2,3,…,n] contains a total of n! unique permutations. By listing and labeling all of the permutations in order, We get the following sequence (ie,...

2018-01-12
1

Leetcode 56 Merge Intervals

Given a collection of intervals, merge all overlapping intervals. For example, Given [1,3],[2,6],[8,10],[15,18], return [1,6],[8,10],[15,18]. 重叠区间合并, 排序后检...

2018-01-12
1

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 maximum jump ...

2018-01-12
1

Leetcode 54 Spiral Matrix

Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order. For example, Given the following matrix:[ [ 1, 2, ...

2018-01-12
1

Leetcode 52 N-Queens II

Follow up for N-Queens problem. Now, instead outputting board configurations, return the total number of distinct solutions. image.png求N皇后解法数量 和上一题一样,代码...

2018-01-12
1

Leetcode 80 Remove Duplicates from Sorted Array II

Follow up for "Remove Duplicates": What if duplicates are allowed at most twice? For example, Giv

2018-01-12
2

Leetcode 78 Subsets

Given a set of distinct integers, nums, return all possible subsets. Note: The solution set must not contain duplicate subsets. For example, If nums = [1,2,...

2018-01-12
1

Leetcode 77 Combinations

Given two integers n and k, return all possible combinations of k numbers out of 1 ... n. For example, If n = 4 and k = 2, a solution is:[ [2,4], [3,4],...

2018-01-12
1