原文链接: https://leetcode-cn.com/problems/maximum-area-of-a-piece-of-cake-after-horizontal-and-vertical-cuts 英文原文You are given a rectangular cake of size h x w and two arrays of integers horizontalCuts and verticalCuts where: horizontalCuts[i] is the di…
标签详情
排序 分类
原文链接: https://leetcode-cn.com/problems/the-k-strongest-values-in-an-array 英文原文Given an array of integers arr and an integer k. A value arr[i] is said to be stronger than a value arr[j] if |arr[i] - m| > |arr[j] - m| where m is the median of the array…
原文链接: https://leetcode-cn.com/problems/least-number-of-unique-integers-after-k-removals 英文原文Given an array of integers arr and an integer k. Find the least number of unique integers after removing exactly k elements. Example 1: Input: arr = [5,5,4], …
原文链接: https://leetcode-cn.com/problems/find-critical-and-pseudo-critical-edges-in-minimum-spanning-tree 英文原文Given a weighted undirected connected graph with n vertices numbered from 0 to n - 1, and an array edges where edges[i] = [ai, bi, weighti] re…
原文链接: https://leetcode-cn.com/problems/range-sum-of-sorted-subarray-sums 英文原文You are given the array nums consisting of n positive integers. You computed the sum of all non-empty continuous subarrays from the array and then sorted them in non-decreas…
原文链接: https://leetcode-cn.com/problems/minimum-difference-between-largest-and-smallest-value-in-three-moves 英文原文Given an array nums, you are allowed to choose one element of nums and change it by any value in one move. Return the minimum difference b…
原文链接: https://leetcode-cn.com/problems/number-of-subsequences-that-satisfy-the-given-sum-condition 英文原文Given an array of integers nums and an integer target. Return the number of non-empty subsequences of nums such that the sum of the minimum and max…
原文链接: https://leetcode-cn.com/problems/can-make-arithmetic-progression-from-sequence 英文原文A sequence of numbers is called an arithmetic progression if the difference between any two consecutive elements is the same. Given an array of numbers arr, retu…
原文链接: https://leetcode-cn.com/problems/magnetic-force-between-two-balls 英文原文In the universe Earth C-137, Rick discovered a special form of magnetic force between two balls if they are put in his new invented basket. Rick has n empty baskets, the ith …
原文链接: https://leetcode-cn.com/problems/maximum-sum-obtained-of-any-permutation 英文原文We have an array of integers, nums, and an array of requests where requests[i] = [starti, endi]. The ith request asks for the sum of nums[starti] + nums[starti + 1] + …
原文链接: https://leetcode-cn.com/problems/check-if-string-is-transformable-with-substring-sort-operations 英文原文Given two strings s and t, you want to transform string s into string t using the following operation any number of times: Choose a non-empty s…
原文链接: https://leetcode-cn.com/problems/alert-using-same-key-card-three-or-more-times-in-a-one-hour-period 英文原文LeetCode company workers use key-cards to unlock office doors. Each time a worker uses their key-card, the security system saves the worker'…
原文链接: https://leetcode-cn.com/problems/special-array-with-x-elements-greater-than-or-equal-x 英文原文You are given an array nums of non-negative integers. nums is considered special if there exists a number x such that there are exactly x numbers in nums…
原文链接: https://leetcode-cn.com/problems/maximum-number-of-visible-points 英文原文You are given an array points, an integer angle, and your location, where location = [posx, posy] and points[i] = [xi, yi] both denote integral coordinates on the X-Y plane. …
原文链接: https://leetcode-cn.com/problems/sort-array-by-increasing-frequency 英文原文Given an array of integers nums, sort the array in increasing order based on the frequency of the values. If multiple values have the same frequency, sort them in decreasin…
原文链接: https://leetcode-cn.com/problems/widest-vertical-area-between-two-points-containing-no-points 英文原文Given n points on a 2D plane where points[i] = [xi, yi], Return the widest vertical area between two points such that no points are inside the are…
原文链接: https://leetcode-cn.com/problems/best-team-with-no-conflicts 英文原文You are the manager of a basketball team. For the upcoming tournament, you want to choose the team with the highest overall score. The score of the team is the sum of scores of al…
原文链接: https://leetcode-cn.com/problems/arithmetic-subarrays 英文原文A sequence of numbers is called arithmetic if it consists of at least two elements, and the difference between every two consecutive elements is the same. More formally, a sequence s is …
原文链接: https://leetcode-cn.com/problems/minimum-deletions-to-make-character-frequencies-unique 英文原文A string s is called good if there are no two different characters in s that have the same frequency. Given a string s, return the minimum number of cha…
原文链接: https://leetcode-cn.com/problems/sell-diminishing-valued-colored-balls 英文原文You have an inventory of different colored balls, and there is a customer that wants orders balls of any color. The customer weirdly values the colored balls. Each color…
原文链接: https://leetcode-cn.com/problems/determine-if-two-strings-are-close 英文原文Two strings are considered close if you can attain one from the other using the following operations: Operation 1: Swap any two existing characters. <ul> <li>For example, <…
原文链接: https://leetcode-cn.com/problems/minimum-interval-to-include-each-query 英文原文You are given a 2D integer array intervals, where intervals[i] = [lefti, righti] describes the ith interval starting at lefti and ending at righti (inclusive). The size…
原文链接: https://leetcode-cn.com/problems/minimize-maximum-pair-sum-in-array 英文原文The pair sum of a pair (a,b) is equal to a + b. The maximum pair sum is the largest pair sum in a list of pairs. For example, if we have pairs (1,5), (2,3), and (4,4), the …
原文链接: https://leetcode-cn.com/problems/reduction-operations-to-make-the-array-elements-equal 英文原文Given an integer array nums, your goal is to make all elements in nums equal. To complete one operation, follow these steps: Find the largest value in nu…
原文链接: https://leetcode-cn.com/problems/minimum-space-wasted-from-packaging 英文原文You have n packages that you are trying to place in boxes, one package in each box. There are m suppliers that each produce boxes of different sizes (with infinite supply)…
原文链接: https://leetcode-cn.com/problems/maximum-product-difference-between-two-pairs 英文原文The product difference between two pairs (a, b) and (c, d) is defined as (a * b) - (c * d). For example, the product difference between (5, 6) and (2, 7) is (5 * …
原文链接: https://leetcode-cn.com/problems/eliminate-maximum-number-of-monsters 英文原文You are playing a video game where you are defending your city from a group of n monsters. You are given a 0-indexed integer array dist of size n, where dist[i] is the in…
原文链接: https://leetcode-cn.com/problems/array-with-elements-not-equal-to-average-of-neighbors 英文原文You are given a 0-indexed array nums of distinct integers. You want to rearrange the elements in the array such that every element in the rearranged arra…
原文链接: https://leetcode-cn.com/problems/minimum-difference-between-highest-and-lowest-of-k-scores 英文原文You are given a 0-indexed integer array nums, where nums[i] represents the score of the ith student. You are also given an integer k. Pick the scores…
原文链接: https://leetcode-cn.com/problems/find-the-kth-largest-integer-in-the-array 英文原文You are given an array of strings nums and an integer k. Each string in nums represents an integer without leading zeros. Return the string that represents the kth l…