Leetcode 0073. Set Matrix Zeroes
73. Set Matrix Zeroes题目Given an *m* x *n* matrix. If an element is 0, set its entire row and column to 0. Do it in-place. Follow up: A straight forward solu...
Leetcode 0072. Edit Distance
72. Edit DistanceGiven two strings word1 and word2, return the minimum number of operations required to convert word1 to word2. You have the following three ...
Leetcode 0071. Simplify Path
71. Simplify PathYou are given an absolute path for a Unix-style file system, which always begins with a slash '/'. Your task is to transform this ab...
Leetcode 0070. Climbing Stairs
70. Climbing Stairs题目You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct w...
Leetcode 0069. Sqrt(x)
69. Sqrt(x)Given a non-negative integer x, return the square root of x rounded down to the nearest integer. The returned integer should be non-negative as we...
Leetcode 0059. Spiral Matrix II
59. Spiral Matrix IIGiven a positive integer n, generate an n x n matrix filled with elements from 1 to n2 in spiral order. Example 1: Example 2: Co...
Leetcode 0055. Jump Game
55. Jump GameYou are given an integer array nums. You are initially positioned at the array's first index, and each element in the array represents your ...
Leetcode 0054. 螺旋矩阵
54. 螺旋矩阵给你一个 m 行 n 列的矩阵 matrix ,请按照 顺时针螺旋顺序 ,返回矩阵中的所有元素。 示例 1: 示例 2: 提示: m == matrix.length n == matrix[i].length 1 <= m, n <= 10 -100 <=...
Leetcode 0053. Maximum Subarray
53. Maximum SubarrayGiven an integer array nums, find the subarray with the largest sum, and return its sum. Example 1: Example 2: Example 3: 题目大意给定...
Leetcode 0048. Rotate Image
48. Rotate ImageYou are given an n x n 2D matrix representing an image, rotate the image by 90 degrees (clockwise). You have to rotate the image in-place, wh...
Leetcode 0046. Permutations
46. PermutationsGiven an array nums of distinct integers, return all the possible permutations. You can return the answer in any order. Example 1: Example...
Leetcode 0045. 跳跃游戏 II
45. 跳跃游戏 II给定一个长度为 n 的 0 索引整数数组 nums。初始位置为 nums[0]。 每个元素 nums[i] 表示从索引 i 向后跳转的最大长度。换句话说,如果你在索引 i 处,你可以跳转到任意 (i + j) 处: 0 <= j <= nums[i] 且 i + j < ...
Leetcode 0042. 接雨水
42. 接雨水给定 n 个非负整数表示每个宽度为 1 的柱子的高度图,计算按此排列的柱子,下雨之后能接多少雨水。 示例 1: 示例 2: 解题思路核心思路是双指针边界,通过每个柱子能接住的雨水量取决于其左右两侧的最高柱子中较矮的那个(短板效应): 边界定义: 对于位置 i,左侧最高柱子高度为 le...
Leetcode 0040. Combination Sum II
40. Combination Sum IIGiven a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the...
Leetcode 0039. Combination Sum
39. Combination SumGiven an array of distinct integers candidates and a target integer target, return a list of all unique combinations of candidates where t...

