题目链接:Spiral MatrixGiven 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...
More »
题目链接:Maximum SubarrayFind 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...
More »
题目链接:N-Queens IIFollow up for N-Queens problem.Now, instead outputting board configurations, return the total number of distinct solutions.这道题的要求是返回N皇后问题总共有多少不同情况。和N-Q...
More »
题目链接:N-QueensThe n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other.Given an integer n, return all disti...
More »
题目链接:AnagramsGiven an array of strings, return all groups of strings that are anagrams.Note: All inputs will be in lower-case.这道题的要求是给定字符串数组,返回能构成异构的所有字符串。anagram,即异构,...
More »
题目链接:Rotate ImageYou are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this in-place?这道题的要求是将n*n的矩阵顺...
More »
题目链接:Permutations IIGiven a collection of numbers that might contain duplicates, return all possible unique permutations.For example,[1,1,2] have the following unique ...
More »
题目链接:PermutationsGiven 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...
More »
题目链接:Jump Game IIGiven 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...
More »