leetcode.com 2023-05-01
🟢1491.average-salary-excluding-the-minimum-and-maximum-salary
🏷️ Tags
#array #sorting
🟢1491.average-salary-excluding-the-minimum-and-maximum-salary
🏷️ Tags
#array #sorting
Telegraph
average-salary-excluding-the-minimum-and-maximum-salary
You are given an array of unique integers salary where salary[i] is the salary of the ith employee. Return the average salary of employees excluding the minimum and maximum salary. Answers within 10-5 of the actual answer will be accepted. Example 1: Input:…
leetcode.cn 2023-05-04
🔴2106.maximum-fruits-harvested-after-at-most-k-steps
🏷️ Tags
#array #binary_search #prefix_sum #sliding_window
🔴2106.maximum-fruits-harvested-after-at-most-k-steps
🏷️ Tags
#array #binary_search #prefix_sum #sliding_window
Telegraph
maximum-fruits-harvested-after-at-most-k-steps
在一个无限的 x 坐标轴上,有许多水果分布在其中某些位置。给你一个二维整数数组 fruits ,其中 fruits[i] = [positioni, amounti] 表示共有 amounti 个水果放置在 positioni 上。fruits 已经按 positioni 升序排列 ,每个 positioni 互不相同 。 另给你两个整数 startPos 和 k 。最初,你位于 startPos 。从任何位置,你可以选择 向左或者向右 走。在 x 轴上每移动 一个单位 ,就记作 一步 。你总共可以走 最多…
leetcode.com 2023-05-05
🟡1456.maximum-number-of-vowels-in-a-substring-of-given-length
🏷️ Tags
#string #sliding_window
🟡1456.maximum-number-of-vowels-in-a-substring-of-given-length
🏷️ Tags
#string #sliding_window
Telegraph
maximum-number-of-vowels-in-a-substring-of-given-length
Given a string s and an integer k, return the maximum number of vowel letters in any substring of s with length k. Vowel letters in English are 'a', 'e', 'i', 'o', and 'u'. Example 1: Input: s = "abciiidef", k = 3 Output: 3 Explanation: The substring "iii"…
leetcode.com 2023-05-06
🟡1498.number-of-subsequences-that-satisfy-the-given-sum-condition
🏷️ Tags
#array #two_pointers #binary_search #sorting
🟡1498.number-of-subsequences-that-satisfy-the-given-sum-condition
🏷️ Tags
#array #two_pointers #binary_search #sorting
Telegraph
number-of-subsequences-that-satisfy-the-given-sum-condition
You are 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 maximum element on it is less or equal to target. Since the answer may be too large, return it modulo 109…
leetcode.cn 2023-05-07
🟡1010.pairs-of-songs-with-total-durations-divisible-by-60
🏷️ Tags
#array #hash_table #counting
🟡1010.pairs-of-songs-with-total-durations-divisible-by-60
🏷️ Tags
#array #hash_table #counting
Telegraph
pairs-of-songs-with-total-durations-divisible-by-60
在歌曲列表中,第 i 首歌曲的持续时间为 time[i] 秒。 返回其总持续时间(以秒为单位)可被 60 整除的歌曲对的数量。形式上,我们希望下标数字 i 和 j 满足 i < j 且有 (time[i] + time[j]) % 60 == 0。 示例 1: 输入:time = [30,20,150,100,40] 输出:3 解释:这三对的总持续时间可被 60 整除: (time[0] = 30, time[2] = 150): 总持续时间 180 (time[1] = 20, time[3] =…
leetcode.com 2023-05-07
🔴1964.find-the-longest-valid-obstacle-course-at-each-position
🏷️ Tags
#binary_indexed_tree #array #binary_search
🔴1964.find-the-longest-valid-obstacle-course-at-each-position
🏷️ Tags
#binary_indexed_tree #array #binary_search
Telegraph
find-the-longest-valid-obstacle-course-at-each-position
You want to build some obstacle courses. You are given a 0-indexed integer array obstacles of length n, where obstacles[i] describes the height of the ith obstacle. For every index i between 0 and n - 1 (inclusive), find the length of the longest obstacle…
leetcode.cn 2023-05-08
🔴1263.minimum-moves-to-move-a-box-to-their-target-location
🏷️ Tags
#breadth_first_search #array #matrix #heap_priority_queue
🔴1263.minimum-moves-to-move-a-box-to-their-target-location
🏷️ Tags
#breadth_first_search #array #matrix #heap_priority_queue
Telegraph
minimum-moves-to-move-a-box-to-their-target-location
「推箱子」是一款风靡全球的益智小游戏,玩家需要将箱子推到仓库中的目标位置。 游戏地图用大小为 m x n 的网格 grid 表示,其中每个元素可以是墙、地板或者是箱子。 现在你将作为玩家参与游戏,按规则将箱子 'B' 移动到目标位置 'T' :