加载中...
分类详情
中等 分类
2-两数相加(Add Two Numbers)
原文链接: https://leetcode-cn.com/problems/add-two-numbers 英文原文You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a single digit. Add the two numbers a…
2021-12-03
6-Z 字形变换(ZigZag Conversion)
原文链接: https://leetcode-cn.com/problems/zigzag-conversion 英文原文The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility) P A H N A P L S …
2021-12-03
15-三数之和(3Sum)
原文链接: https://leetcode-cn.com/problems/3sum 英文原文Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, and j != k, and nums[i] + nums[j] + nums[k] == 0. Notice that the solution set must not contain…
2021-12-03
18-四数之和(4Sum)
原文链接: https://leetcode-cn.com/problems/4sum 英文原文Given an array nums of n integers, return an array of all the unique quadruplets [nums[a], nums[b], nums[c], nums[d]] such that: 0 <= a, b, c, d < n a, b, c, and d are distinct. nums[a] + nums[b] + nums…
2021-12-03
29-两数相除(Divide Two Integers)
原文链接: https://leetcode-cn.com/problems/divide-two-integers 英文原文Given two integers dividend and divisor, divide two integers without using multiplication, division, and mod operator. The integer division should truncate toward zero, which means losing…
2021-12-03
31-下一个排列(Next Permutation)
原文链接: https://leetcode-cn.com/problems/next-permutation 英文原文Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such an arrangement is not possible, it must rearrange it as the lowes…
2021-12-03
36-有效的数独(Valid Sudoku)
原文链接: https://leetcode-cn.com/problems/valid-sudoku 英文原文Determine if a 9 x 9 Sudoku board is valid. Only the filled cells need to be validated according to the following rules: Each row must contain the digits 1-9 without repetition. Each column must…
2021-12-03
39-组合总和(Combination Sum)
原文链接: https://leetcode-cn.com/problems/combination-sum 英文原文Given an array of distinct integers candidates and a target integer target, return a list of all unique combinations of candidates where the chosen numbers sum to target. You may return the c…
2021-12-03
40-组合总和 II(Combination Sum II)
原文链接: https://leetcode-cn.com/problems/combination-sum-ii 英文原文Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numbers sum to target. Each number in cand…
2021-12-03
43-字符串相乘(Multiply Strings)
原文链接: https://leetcode-cn.com/problems/multiply-strings 英文原文Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2, also represented as a string. Note: You must not use any built-in BigInteger librar…
2021-12-03
45-跳跃游戏 II(Jump Game II)
原文链接: https://leetcode-cn.com/problems/jump-game-ii 英文原文Given an array of non-negative integers nums, 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 g…
2021-12-03
46-全排列(Permutations)
原文链接: https://leetcode-cn.com/problems/permutations 英文原文Given an array nums of distinct integers, return all the possible permutations. You can return the answer in any order. Example 1: Input: nums = [1,2,3] Output: [[1,2,3],[1,3,2],[2,1,3],[2,3,1],…
2021-12-03
47-全排列 II(Permutations II)
原文链接: https://leetcode-cn.com/problems/permutations-ii 英文原文Given a collection of numbers, nums, that might contain duplicates, return all possible unique permutations in any order. Example 1: Input: nums = [1,1,2] Output: [[1,1,2], [1,2,1], [2,1,1]] …
2021-12-03
48-旋转图像(Rotate Image)
原文链接: https://leetcode-cn.com/problems/rotate-image 英文原文You 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, which means you have to modify the input 2D matrix dire…
2021-12-03
50-Pow(x, n)
原文链接: https://leetcode-cn.com/problems/powx-n 英文原文Implement pow(x, n), which calculates x raised to the power n (i.e., xn). Example 1: Input: x = 2.00000, n = 10 Output: 1024.00000 Example 2: Input: x = 2.10000, n = 3 Output: 9.26100 Example 3: Input…
2021-12-03
54-螺旋矩阵(Spiral Matrix)
原文链接: https://leetcode-cn.com/problems/spiral-matrix 英文原文Given an m x n matrix, return all elements of the matrix in spiral order. Example 1: Input: matrix = [[1,2,3],[4,5,6],[7,8,9]] Output: [1,2,3,6,9,8,7,4,5] Example 2: Input: matrix = [[1,2,3,4],…
2021-12-03
55-跳跃游戏(Jump Game)
原文链接: https://leetcode-cn.com/problems/jump-game 英文原文You are given an integer array nums. You are initially positioned at the array's first index, and each element in the array represents your maximum jump length at that position. Return true if you …
2021-12-03
56-合并区间(Merge Intervals)
原文链接: https://leetcode-cn.com/problems/merge-intervals 英文原文Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals, and return an array of the non-overlapping intervals that cover all the intervals in the inpu…
2021-12-03
57-插入区间(Insert Interval)
原文链接: https://leetcode-cn.com/problems/insert-interval 英文原文You are given an array of non-overlapping intervals intervals where intervals[i] = [starti, endi] represent the start and the end of the ith interval and intervals is sorted in ascending orde…
2021-12-03
59-螺旋矩阵 II(Spiral Matrix II)
原文链接: https://leetcode-cn.com/problems/spiral-matrix-ii 英文原文Given a positive integer n, generate an n x n matrix filled with elements from 1 to n2 in spiral order. Example 1: Input: n = 3 Output: [[1,2,3],[8,9,4],[7,6,5]] Example 2: Input: n = 1 Outp…
2021-12-03