加载中...
分类详情
中等 分类
189-轮转数组(Rotate Array)
原文链接: https://leetcode-cn.com/problems/rotate-array 英文原文Given an array, rotate the array to the right by k steps, where k is non-negative. Example 1: Input: nums = [1,2,3,4,5,6,7], k = 3 Output: [5,6,7,1,2,3,4] Explanation: rotate 1 steps to the righ…
2021-12-03
194-转置文件(Transpose File)
原文链接: https://leetcode-cn.com/problems/transpose-file 英文原文Given a text file file.txt, transpose its content. You may assume that each row has the same number of columns, and each field is separated by the ' ' character. Example: If file.txt has the f…
2021-12-03
198-打家劫舍(House Robber)
原文链接: https://leetcode-cn.com/problems/house-robber 英文原文You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent…
2021-12-03
204-计数质数(Count Primes)
原文链接: https://leetcode-cn.com/problems/count-primes 英文原文Given an integer n, return the number of prime numbers that are strictly less than n. Example 1: Input: n = 10 Output: 4 Explanation: There are 4 prime numbers less than 10, they are 2, 3, 5, 7.…
2021-12-03
213-打家劫舍 II(House Robber II)
原文链接: https://leetcode-cn.com/problems/house-robber-ii 英文原文You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed. All houses at this place are arranged in a circle. That means the first …
2021-12-03
216-组合总和 III(Combination Sum III)
原文链接: https://leetcode-cn.com/problems/combination-sum-iii 英文原文Find all valid combinations of k numbers that sum up to n such that the following conditions are true: Only numbers 1 through 9 are used. Each number is used at most once. Return a list o…
2021-12-03
221-最大正方形(Maximal Square)
原文链接: https://leetcode-cn.com/problems/maximal-square 英文原文Given an m x n binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area. Example 1: Input: matrix = [["1","0","1","0","0"],["1","0","1","1","1"],[…
2021-12-03
223-矩形面积(Rectangle Area)
原文链接: https://leetcode-cn.com/problems/rectangle-area 英文原文Given the coordinates of two rectilinear rectangles in a 2D plane, return the total area covered by the two rectangles. The first rectangle is defined by its bottom-left corner (ax1, ay1) and …
2021-12-03
227-基本计算器 II(Basic Calculator II)
原文链接: https://leetcode-cn.com/problems/basic-calculator-ii 英文原文Given a string s which represents an expression, evaluate this expression and return its value. The integer division should truncate toward zero. You may assume that the given expression …
2021-12-03
274-H 指数(H-Index)
原文链接: https://leetcode-cn.com/problems/h-index 英文原文Given an array of integers citations where citations[i] is the number of citations a researcher received for their ith paper, return compute the researcher's h-index. According to the definition of h…
2021-12-03