原文链接: https://leetcode-cn.com/problems/ipo 英文原文Suppose LeetCode will start its IPO soon. In order to sell a good price of its shares to Venture Capital, LeetCode would like to work on some projects to increase its capital before the IPO. Since it has…
标签详情
排序 分类
原文链接: https://leetcode-cn.com/problems/relative-ranks 英文原文You are given an integer array score of size n, where score[i] is the score of the ith athlete in a competition. All the scores are guaranteed to be unique. The athletes are placed based on th…
原文链接: https://leetcode-cn.com/problems/longest-uncommon-subsequence-ii 英文原文Given an array of strings strs, return the length of the longest uncommon subsequence between them. If the longest uncommon subsequence does not exist, return -1. An uncommon …
原文链接: https://leetcode-cn.com/problems/longest-word-in-dictionary-through-deleting 英文原文Given a string s and a string array dictionary, return the longest string in the dictionary that can be formed by deleting some of the given string characters. If …
原文链接: https://leetcode-cn.com/problems/minimum-time-difference 英文原文Given a list of 24-hour clock time points in "HH:MM" format, return the minimum minutes difference between any two time-points in the list. Example 1: Input: timePoints = ["23:59","00…
原文链接: https://leetcode-cn.com/problems/array-partition-i 英文原文Given an integer array nums of 2n integers, group these integers into n pairs (a1, b1), (a2, b2), ..., (an, bn) such that the sum of min(ai, bi) for all i is maximized. Return the maximized…
原文链接: https://leetcode-cn.com/problems/shortest-unsorted-continuous-subarray 英文原文Given an integer array nums, you need to find one continuous subarray that if you only sort this subarray in ascending order, then the whole array will be sorted in asce…
原文链接: https://leetcode-cn.com/problems/longest-harmonious-subsequence 英文原文We define a harmonious array as an array where the difference between its maximum value and its minimum value is exactly 1. Given an integer array nums, return the length of it…
原文链接: https://leetcode-cn.com/problems/valid-triangle-number 英文原文Given an integer array nums, return the number of triplets chosen from the array that can make triangles if we take them as side lengths of a triangle. Example 1: Input: nums = [2,2,3,4…
原文链接: https://leetcode-cn.com/problems/task-scheduler 英文原文Given a characters array tasks, representing the tasks a CPU needs to do, where each letter represents a different task. Tasks could be done in any order. Each task is done in one unit of time…
原文链接: https://leetcode-cn.com/problems/maximum-product-of-three-numbers 英文原文Given an integer array nums, find three numbers whose product is maximum and return the maximum product. Example 1: Input: nums = [1,2,3] Output: 6 Example 2: Input: nums = […
原文链接: https://leetcode-cn.com/problems/smallest-range-covering-elements-from-k-lists 英文原文You have k lists of sorted integers in non-decreasing order. Find the smallest range that includes at least one number from each of the k lists. We define the ra…
原文链接: https://leetcode-cn.com/problems/set-mismatch 英文原文You have a set of integers s, which originally contains all the numbers from 1 to n. Unfortunately, due to some error, one of the numbers in s got duplicated to another number in the set, which …
原文链接: https://leetcode-cn.com/problems/maximum-length-of-pair-chain 英文原文You are given an array of n pairs pairs where pairs[i] = [lefti, righti] and lefti < righti. A pair p2 = [c, d] follows a pair p1 = [a, b] if b < c. A chain of pairs can be forme…
原文链接: https://leetcode-cn.com/problems/find-k-closest-elements 英文原文Given a sorted integer array arr, two integers k and x, return the k closest integers to x in the array. The result should also be sorted in ascending order. An integer a is closer to…
原文链接: https://leetcode-cn.com/problems/top-k-frequent-words 英文原文Given an array of strings words and an integer k, return the k most frequent strings. Return the answer sorted by the frequency from highest to lowest. Sort the words with the same frequ…
原文链接: https://leetcode-cn.com/problems/find-k-th-smallest-pair-distance 英文原文The distance of a pair of integers a and b is defined as the absolute difference between a and b. Given an integer array nums and an integer k, return the kth smallest distan…
原文链接: https://leetcode-cn.com/problems/longest-word-in-dictionary 英文原文Given an array of strings words representing an English Dictionary, return the longest word in words that can be built one character at a time by other words in words. If there is …
原文链接: https://leetcode-cn.com/problems/largest-number-at-least-twice-of-others 英文原文You are given an integer array nums where the largest integer is unique. Determine whether the largest element in the array is at least twice as much as every other nu…
原文链接: https://leetcode-cn.com/problems/set-intersection-size-at-least-two 英文原文An integer interval [a, b] (for integers a < b) is a set of all consecutive integers from a to b, including a and b. Find the minimum size of a set S such that for every in…
原文链接: https://leetcode-cn.com/problems/reorganize-string 英文原文Given a string s, rearrange the characters of s so that any two adjacent characters are not the same. Return any possible rearrangement of s or return "" if not possible. Example 1: Input: …
原文链接: https://leetcode-cn.com/problems/max-chunks-to-make-sorted-ii 英文原文You are given an integer array arr. We split arr into some number of chunks (i.e., partitions), and individually sort each chunk. After concatenating them, the result should equa…
原文链接: https://leetcode-cn.com/problems/max-chunks-to-make-sorted 英文原文You are given an integer array arr of length n that represents a permutation of the integers in the range [0, n - 1]. We split arr into some number of chunks (i.e., partitions), and…
原文链接: https://leetcode-cn.com/problems/custom-sort-string 英文原文You are given two strings order and s. All the words of order are unique and were sorted in some custom order previously. Permute the characters of s so that they match the order that orde…
原文链接: https://leetcode-cn.com/problems/friends-of-appropriate-ages 英文原文There are n persons on a social media website. You are given an integer array ages where ages[i] is the age of the ith person. A Person x will not send a friend request to a perso…
原文链接: https://leetcode-cn.com/problems/most-profit-assigning-work 英文原文You have n jobs and m workers. You are given three arrays: difficulty, profit, and worker where: difficulty[i] and profit[i] are the difficulty and the profit of the ith job, and w…
原文链接: https://leetcode-cn.com/problems/find-and-replace-in-string 英文原文You are given a 0-indexed string s that you must perform k replacement operations on. The replacement operations are given as three 0-indexed parallel arrays, indices, sources, and…
原文链接: https://leetcode-cn.com/problems/hand-of-straights 英文原文Alice has some number of cards and she wants to rearrange the cards into groups so that each group is of size groupSize, and consists of groupSize consecutive cards. Given an integer array …
原文链接: https://leetcode-cn.com/problems/car-fleet 英文原文There are n cars going to the same destination along a one-lane road. The destination is target miles away. You are given two integer array position and speed, both of length n, where position[i] i…
原文链接: https://leetcode-cn.com/problems/minimum-cost-to-hire-k-workers 英文原文There are n workers. You are given two integer arrays quality and wage where quality[i] is the quality of the ith worker and wage[i] is the minimum wage expectation for the ith…