leetcode.cn 2025-04-26
🔴2444.count-subarrays-with-fixed-bounds
🏷️ Tags
#queue #array #sliding_window #monotonic_queue
🔴2444.count-subarrays-with-fixed-bounds
🏷️ Tags
#queue #array #sliding_window #monotonic_queue
Telegraph
count-subarrays-with-fixed-bounds
给你一个整数数组 nums 和两个整数 minK 以及 maxK 。 nums 的定界子数组是满足下述条件的一个子数组:
leetcode.com 2025-04-26
🔴2444.count-subarrays-with-fixed-bounds
🏷️ Tags
#queue #array #sliding_window #monotonic_queue
🔴2444.count-subarrays-with-fixed-bounds
🏷️ Tags
#queue #array #sliding_window #monotonic_queue
Telegraph
count-subarrays-with-fixed-bounds
You are given an integer array nums and two integers minK and maxK. A fixed-bound subarray of nums is a subarray that satisfies the following conditions:
leetcode.cn 2025-04-28
🔴2302.count-subarrays-with-score-less-than-k
🏷️ Tags
#array #binary_search #prefix_sum #sliding_window
🔴2302.count-subarrays-with-score-less-than-k
🏷️ Tags
#array #binary_search #prefix_sum #sliding_window
Telegraph
count-subarrays-with-score-less-than-k
一个数组的 分数 定义为数组之和 乘以 数组的长度。
leetcode.com 2025-04-28
🔴2302.count-subarrays-with-score-less-than-k
🏷️ Tags
#array #binary_search #prefix_sum #sliding_window
🔴2302.count-subarrays-with-score-less-than-k
🏷️ Tags
#array #binary_search #prefix_sum #sliding_window
Telegraph
count-subarrays-with-score-less-than-k
The score of an array is defined as the product of its sum and its length.
leetcode.cn 2025-04-29
🟡2962.count-subarrays-where-max-element-appears-at-least-k-times
🏷️ Tags
#array #sliding_window
🟡2962.count-subarrays-where-max-element-appears-at-least-k-times
🏷️ Tags
#array #sliding_window
Telegraph
count-subarrays-where-max-element-appears-at-least-k-times
给你一个整数数组 nums 和一个 正整数 k 。 请你统计有多少满足 「 nums 中的 最大 元素」至少出现 k 次的子数组,并返回满足这一条件的子数组的数目。 子数组是数组中的一个连续元素序列。 示例 1: 输入:nums = [1,3,2,3,3], k = 2 输出:6 解释:包含元素 3 至少 2 次的子数组为:[1,3,2,3]、[1,3,2,3,3]、[3,2,3]、[3,2,3,3]、[2,3,3] 和 [3,3] 。 示例 2: 输入:nums = [1,4,2,1], k = 3…
leetcode.com 2025-04-29
🟡2962.count-subarrays-where-max-element-appears-at-least-k-times
🏷️ Tags
#array #sliding_window
🟡2962.count-subarrays-where-max-element-appears-at-least-k-times
🏷️ Tags
#array #sliding_window
Telegraph
count-subarrays-where-max-element-appears-at-least-k-times
You are given an integer array nums and a positive integer k. Return the number of subarrays where the maximum element of nums appears at least k times in that subarray. A subarray is a contiguous sequence of elements within an array. Example 1: Input:…
leetcode.cn 2025-05-01
🔴2071.maximum-number-of-tasks-you-can-assign
🏷️ Tags
#greedy #queue #array #binary_search #sorting #monotonic_queue
🔴2071.maximum-number-of-tasks-you-can-assign
🏷️ Tags
#greedy #queue #array #binary_search #sorting #monotonic_queue
Telegraph
maximum-number-of-tasks-you-can-assign
给你 n 个任务和 m 个工人。每个任务需要一定的力量值才能完成,需要的力量值保存在下标从 0 开始的整数数组 tasks 中,第 i 个任务需要 tasks[i] 的力量才能完成。每个工人的力量值保存在下标从 0 开始的整数数组 workers 中,第 j 个工人的力量值为 workers[j] 。每个工人只能完成 一个 任务,且力量值需要 大于等于 该任务的力量要求值(即 workers[j] >= tasks[i] )。 除此以外,你还有 pills 个神奇药丸,可以给 一个工人的力量值 增加 s…
leetcode.com 2025-05-01
🔴2071.maximum-number-of-tasks-you-can-assign
🏷️ Tags
#greedy #queue #array #binary_search #sorting #monotonic_queue
🔴2071.maximum-number-of-tasks-you-can-assign
🏷️ Tags
#greedy #queue #array #binary_search #sorting #monotonic_queue
Telegraph
maximum-number-of-tasks-you-can-assign
You have n tasks and m workers. Each task has a strength requirement stored in a 0-indexed integer array tasks, with the ith task requiring tasks[i] strength to complete. The strength of each worker is stored in a 0-indexed integer array workers, with the…