题库chevron_right分类chevron_right单调队列
label

单调队列

18 道题目
简单: 0中等: 7困难: 11

单调队列 是技术面试里最常出现的能力维度之一。建议先掌握基础题型的边界处理,再逐步过渡到模式识别和复杂度 trade-off。

面试场景

高频考察问题建模、边界条件与口头表达的清晰度。

常见误区

只背模板不解释为什么,容易在追问里失分。

练习策略

每轮练 3-5 题,固定复盘复杂度和可替代解法。

推荐练习顺序

#题目难度
239

滑动窗口最大值

Solve the "Sliding Window Maximum" problem using efficient techniques like the sliding window, deque, and priority queue…

困难
862

和至少为 K 的最短子数组

Find the shortest subarray with a sum of at least k using binary search and sliding window techniques.

困难
918

环形子数组的最大和

Find the maximum sum of a circular subarray using state transition dynamic programming, optimizing for wraparound cases …

中等
1425

带限制的子序列和

Solve the Constrained Subsequence Sum problem using dynamic programming, sliding window, and priority queues to maximize…

困难
1438

绝对差不超过限制的最长连续子数组

Find the longest subarray with elements whose absolute difference is within a specified limit using a sliding window app…

中等
1499

满足不等式的最大值

Max Value of Equation asks to find the maximum value of a specific equation on a set of 2D points using sliding window t…

困难
1687

从仓库到码头运输箱子

Optimize the minimum number of trips to deliver boxes to ports under strict ship constraints using dynamic programming t…

困难
1696

跳跃游戏 VI

Jump Game VI challenges you to maximize your score while jumping through an array using state transition dynamic program…

中等
2071

你可以安排的最多任务数目

Maximize the number of tasks that can be completed by efficiently using workers and magical pills.

困难
2398

预算内的最多机器人数目

Determine the maximum number of consecutive robots you can operate without exceeding a given budget using efficient bina…

困难
2407

最长递增子序列 II

Determine the longest increasing subsequence in an array where consecutive elements differ by at most k using dynamic pr…

困难
2444

统计定界子数组的数目

Count all subarrays where the minimum and maximum match given bounds using efficient sliding window tracking techniques.

困难
2762

不间断子数组

Count all continuous subarrays efficiently using sliding window with running max-min state tracking for array consistenc…

中等
2944

购买水果需要的最少金币数

Calculate the minimum coins to buy fruits using state transition dynamic programming while handling rewards and purchase…

中等
2945

找到最大非递减数组的长度

Solve Find Maximum Non-decreasing Array Length with prefix-sum DP transitions that maximize kept segments while preservi…

困难
3420

统计 K 次操作以内得到非递减子数组的数目

This problem asks you to count non-decreasing subarrays in a given array after applying at most k operations.

困难
3578

统计极差最大为 K 的分割方式数

Count the number of valid ways to partition an array into contiguous segments where max-min difference is at most k.

中等
3589

计数质数间隔平衡子数组

Count the number of prime-gap balanced subarrays in an integer array using sliding window techniques and running state u…

中等

关联高频模式

LeetCode 单调队列题型题解:18题训练路线