最新 最热

Python|欧拉筛法求质数

我们知道第一个质数是 2、第二个质数是 3、第三个质数是 5……请你计算第 2020 个质数是多少?

2020-09-24
1

Array - 54. Spiral Matrix

Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.

2020-09-23
1

DFS&BFS - 52. N-Queens II

The n-queens puzzle is the problem of placing n queens on an n_×_n chessboard such that no two queens attack each other.

2020-09-23
1

Binary Search - 33. Search in Rotated Sorted Array

Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.

2020-09-23
1

Backtracking - 78. Subsets

Given a set of distinct integers, nums, return all possible subsets (the power set).

2020-09-23
1

Backtracking - 77. Combinations

Given two integers n and k, return all possible combinations of k numbers out of 1 ... n.

2020-09-23
1

Backtracking - 46. Permutations

46. Permutations Given a collection of distinct integers, return all possible permutations.

2020-09-23
1

Backtracking - 47. Permutations II

Given a collection of numbers that might contain duplicates, return all possible unique permutations.

2020-09-23
2

Backtracking - 60. Permutation Sequence

The set [1,2,3,...,_n_] contains a total of n! unique permutations.

2020-09-23
1