原文链接: https://leetcode-cn.com/problems/remove-covered-intervals 英文原文Given an array intervals where intervals[i] = [li, ri] represent the interval [li, ri), remove all intervals that are covered by another interval in the list. The interval [a, b) is …
标签详情
排序 分类
原文链接: https://leetcode-cn.com/problems/sum-of-mutated-array-closest-to-target 英文原文Given an integer array arr and a target value target, return the integer value such that when we change all the integers larger than value in the given array to be equa…
原文链接: https://leetcode-cn.com/problems/sort-the-matrix-diagonally 英文原文A matrix diagonal is a diagonal line of cells starting from some cell in either the topmost row or leftmost column and going in the bottom-right direction until reaching the matrix…
原文链接: https://leetcode-cn.com/problems/rank-transform-of-an-array 英文原文Given an array of integers arr, replace each element with its rank. The rank represents how large the element is. The rank has the following rules: Rank is an integer starting from…
原文链接: https://leetcode-cn.com/problems/compare-strings-by-frequency-of-the-smallest-character 英文原文Let the function f(s) be the frequency of the lexicographically smallest character in a non-empty string s. For example, if s = "dcce" then f(s) = 2 bec…
原文链接: https://leetcode-cn.com/problems/maximum-profit-in-job-scheduling 英文原文We have n jobs, where every job is scheduled to be done from startTime[i] to endTime[i], obtaining a profit of profit[i]. You're given the startTime, endTime and profit array…
原文链接: https://leetcode-cn.com/problems/maximum-height-by-stacking-cuboids 英文原文Given n cuboids where the dimensions of the ith cuboid is cuboids[i] = [widthi, lengthi, heighti] (0-indexed). Choose a subset of cuboids and place them on each other. You …
原文链接: https://leetcode-cn.com/problems/divide-array-in-sets-of-k-consecutive-numbers 英文原文Given an array of integers nums and a positive integer k, find whether it is possible to divide this array into sets of k consecutive numbers. Return true if it …
原文链接: https://leetcode-cn.com/problems/all-elements-in-two-binary-search-trees 英文原文Given two binary search trees root1 and root2. Return a list containing all the integers from both trees sorted in ascending order. Example 1: Input: root1 = [2,1,4], …
原文链接: https://leetcode-cn.com/problems/get-watched-videos-by-your-friends 英文原文There are n people, each person has a unique id between 0 and n-1. Given the arrays watchedVideos and friends, where watchedVideos[i] and friends[i] contain the list of wat…
原文链接: https://leetcode-cn.com/problems/filter-restaurants-by-vegan-friendly-price-and-distance 英文原文Given the array restaurants where restaurants[i] = [idi, ratingi, veganFriendlyi, pricei, distancei]. You have to filter the restaurants using three fi…
原文链接: https://leetcode-cn.com/problems/sort-integers-by-the-number-of-1-bits 英文原文Given an integer array arr. You have to sort the integers in the array in ascending order by the number of 1's in their binary representation and in case of two or more …
原文链接: https://leetcode-cn.com/problems/the-k-weakest-rows-in-a-matrix 英文原文You are given an m x n binary matrix mat of 1's (representing soldiers) and 0's (representing civilians). The soldiers are positioned in front of the civilians. That is, all th…
原文链接: https://leetcode-cn.com/problems/reduce-array-size-to-the-half 英文原文You are given an integer array arr. You can choose a set of integers and remove all the occurrences of these integers in the array. Return the minimum size of the set so that at…
原文链接: https://leetcode-cn.com/problems/jump-game-v 英文原文Given an array of integers arr and an integer d. In one step you can jump from index i to index: i + x where: i + x < arr.length and 0 < x <= d. i - x where: i - x >= 0 and 0 < x <= d. In additio…
原文链接: https://leetcode-cn.com/problems/check-if-n-and-its-double-exist 英文原文Given an array arr of integers, check if there exists two integers N and M such that N is the double of M ( i.e. N = 2 * M). More formally check if there exists two indices i …
原文链接: https://leetcode-cn.com/problems/tweet-counts-per-frequency 英文原文A social media company is trying to monitor activity on their site by analyzing the number of tweets that occur in select periods of time. These periods can be partitioned into sma…
原文链接: https://leetcode-cn.com/problems/how-many-numbers-are-smaller-than-the-current-number 英文原文Given the array nums, for each nums[i] find out how many numbers in the array are smaller than it. That is, for each nums[i] you have to count the number …
原文链接: https://leetcode-cn.com/problems/find-the-distance-value-between-two-arrays 英文原文Given two integer arrays arr1 and arr2, and the integer d, return the distance value between the two arrays. The distance value is defined as the number of elements…
原文链接: https://leetcode-cn.com/problems/sort-integers-by-the-power-value 英文原文The power of an integer x is defined as the number of steps needed to transform x into 1 using the following steps: if x is even then x = x / 2 if x is odd then x = 3 * x + 1…
原文链接: https://leetcode-cn.com/problems/maximum-performance-of-a-team 英文原文You are given two integers n and k and two integer arrays speed and efficiency both of length n. There are n engineers numbered from 1 to n. speed[i] and efficiency[i] represent…
原文链接: https://leetcode-cn.com/problems/reducing-dishes 英文原文A chef has collected data on the satisfaction level of his n dishes. Chef can cook any dish in 1 unit of time. Like-time coefficient of a dish is defined as the time taken to cook that dish i…
原文链接: https://leetcode-cn.com/problems/minimum-subsequence-in-non-increasing-order 英文原文Given the array nums, obtain a subsequence of the array whose sum of elements is strictly greater than the sum of the non included elements in such subsequence. If…
原文链接: https://leetcode-cn.com/problems/check-if-a-string-can-break-another-string 英文原文Given two strings: s1 and s2 with the same size, check if some permutation of string s1 can break some permutation of string s2 or vice-versa. In other words s2 can…
原文链接: https://leetcode-cn.com/problems/display-table-of-food-orders-in-a-restaurant 英文原文Given the array orders, which represents the orders that customers have done in a restaurant. More specifically orders[i]=[customerNamei,tableNumberi,foodItemi] w…
原文链接: https://leetcode-cn.com/problems/diagonal-traverse-ii 英文原文Given a list of lists of integers, nums, return all elements of nums in diagonal order as shown in the below images. Example 1: Input: nums = [[1,2,3],[4,5,6],[7,8,9]] Output: [1,4,2,7,5…
原文链接: https://leetcode-cn.com/problems/make-two-arrays-equal-by-reversing-sub-arrays 英文原文Given two integer arrays of equal length target and arr. In one step, you can select any non-empty sub-array of arr and reverse it. You are allowed to make any n…
原文链接: https://leetcode-cn.com/problems/rearrange-words-in-a-sentence 英文原文Given a sentence text (A sentence is a string of space-separated words) in the following format: First letter is in upper case. Each word in text are separated by a single space…
原文链接: https://leetcode-cn.com/problems/allocate-mailboxes 英文原文Given the array houses and an integer k. where houses[i] is the location of the ith house along a street, your task is to allocate k mailboxes in the street. Return the minimum total dista…
原文链接: https://leetcode-cn.com/problems/maximum-product-of-two-elements-in-an-array 英文原文Given the array of integers nums, you will choose two different indices i and j of that array. Return the maximum value of (nums[i]-1)*(nums[j]-1). Example 1: Inpu…