加载中...
分类详情
中等 分类
61-旋转链表(Rotate List)
原文链接: https://leetcode-cn.com/problems/rotate-list 英文原文Given the head of a linked list, rotate the list to the right by k places. Example 1: Input: head = [1,2,3,4,5], k = 2 Output: [4,5,1,2,3] Example 2: Input: head = [0,1,2], k = 4 Output: [2,0,1] …
2021-12-03
62-不同路径(Unique Paths)
原文链接: https://leetcode-cn.com/problems/unique-paths 英文原文A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only move either down or right at any point in time. The robot is trying to reach t…
2021-12-03
63-不同路径 II(Unique Paths II)
原文链接: https://leetcode-cn.com/problems/unique-paths-ii 英文原文A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only move either down or right at any point in time. The robot is trying to reac…
2021-12-03
64-最小路径和(Minimum Path Sum)
原文链接: https://leetcode-cn.com/problems/minimum-path-sum 英文原文Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right, which minimizes the sum of all numbers along its path. Note: You can only move either down or …
2021-12-03
71-简化路径(Simplify Path)
原文链接: https://leetcode-cn.com/problems/simplify-path 英文原文Given a string path, which is an absolute path (starting with a slash '/') to a file or directory in a Unix-style file system, convert it to the simplified canonical path. In a Unix-style file …
2021-12-03
73-矩阵置零(Set Matrix Zeroes)
原文链接: https://leetcode-cn.com/problems/set-matrix-zeroes 英文原文Given an m x n integer matrix matrix, if an element is 0, set its entire row and column to 0's, and return the matrix. You must do it in place. Example 1: Input: matrix = [[1,1,1],[1,0,1],[…
2021-12-03
75-颜色分类(Sort Colors)
原文链接: https://leetcode-cn.com/problems/sort-colors 英文原文Given an array nums with n objects colored red, white, or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the order red, white, and blue. We will use t…
2021-12-03
77-组合(Combinations)
原文链接: https://leetcode-cn.com/problems/combinations 英文原文Given two integers n and k, return all possible combinations of k numbers out of the range [1, n]. You may return the answer in any order. Example 1: Input: n = 4, k = 2 Output: [ [2,4], [3,4], …
2021-12-03
78-子集(Subsets)
原文链接: https://leetcode-cn.com/problems/subsets 英文原文Given an integer array nums of unique elements, return all possible subsets (the power set). The solution set must not contain duplicate subsets. Return the solution in any order. Example 1: Input: n…
2021-12-03
79-单词搜索(Word Search)
原文链接: https://leetcode-cn.com/problems/word-search 英文原文Given an m x n grid of characters board and a string word, return true if word exists in the grid. The word can be constructed from letters of sequentially adjacent cells, where adjacent cells ar…
2021-12-03
86-分隔链表(Partition List)
原文链接: https://leetcode-cn.com/problems/partition-list 英文原文Given the head of a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should preserve the original relative order of the…
2021-12-03
89-格雷编码(Gray Code)
原文链接: https://leetcode-cn.com/problems/gray-code 英文原文An n-bit gray code sequence is a sequence of 2n integers where: Every integer is in the inclusive range [0, 2n - 1], The first integer is 0, An integer appears no more than once in the sequence, Th…
2021-12-03
90-子集 II(Subsets II)
原文链接: https://leetcode-cn.com/problems/subsets-ii 英文原文Given an integer array nums that may contain duplicates, return all possible subsets (the power set). The solution set must not contain duplicate subsets. Return the solution in any order. Example…
2021-12-03
91-解码方法(Decode Ways)
原文链接: https://leetcode-cn.com/problems/decode-ways 英文原文A message containing letters from A-Z can be encoded into numbers using the following mapping: 'A' -> "1" 'B' -> "2" ... 'Z' -> "26" To decode an encoded message, all the digits must be grouped t…
2021-12-03
93-复原 IP 地址(Restore IP Addresses)
原文链接: https://leetcode-cn.com/problems/restore-ip-addresses 英文原文A valid IP address consists of exactly four integers separated by single dots. Each integer is between 0 and 255 (inclusive) and cannot have leading zeros. For example, "0.1.2.201" and "…
2021-12-03
97-交错字符串(Interleaving String)
原文链接: https://leetcode-cn.com/problems/interleaving-string 英文原文Given strings s1, s2, and s3, find whether s3 is formed by an interleaving of s1 and s2. An interleaving of two strings s and t is a configuration where they are divided into non-empty su…
2021-12-03