跳至主要內容

贪心


贪心

全部标签

数据结构

数组 矩阵 链表 双向链表 单调栈 队列 单调队列 堆(优先队列) 哈希表 字符串 字符串匹配 二叉树 二叉搜索树 最小生成树 有序集合 拓扑排序 最短路 强连通分量 欧拉回路 双连通分量 并查集 字典树 线段树 树状数组 后缀数组

算法

枚举 递归 分治 回溯 贪心 动态规划 排序 桶排序 计数排序 基数排序 归并排序 快速选择 二分查找 记忆化搜索 深度优先搜索 广度优先搜索 双指针 位运算 前缀和 计数 滑动窗口 状态压缩 哈希函数 滚动哈希 扫描线

其他

数学 数论 几何 博弈 模拟 组合数学 随机化 概率与统计 水塘抽样 拒绝采样 数据库 设计 数据流 脑筋急转弯 交互 迭代器 多线程


题号标题题解标签难度力扣
11盛最多水的容器[✓]贪心 数组 双指针🟠🀄️open in new window 🔗open in new window
44通配符匹配[✓]贪心 递归 字符串 1+🔴🀄️open in new window 🔗open in new window
45跳跃游戏 II[✓]贪心 数组 动态规划🟠🀄️open in new window 🔗open in new window
55跳跃游戏[✓]贪心 数组 动态规划🟠🀄️open in new window 🔗open in new window
122买卖股票的最佳时机 II[✓]贪心 数组 动态规划🟠🀄️open in new window 🔗open in new window
134加油站[✓]贪心 数组🟠🀄️open in new window 🔗open in new window
135分发糖果[✓]贪心 数组🔴🀄️open in new window 🔗open in new window
179最大数贪心 数组 字符串 1+🟠🀄️open in new window 🔗open in new window
253会议室 II 🔒贪心 数组 双指针 3+🟠🀄️open in new window 🔗open in new window
280摆动排序 🔒贪心 数组 排序🟠🀄️open in new window 🔗open in new window
316去除重复字母[✓] 贪心 字符串 1+🟠🀄️open in new window 🔗open in new window
321拼接最大数 贪心 数组 2+🔴🀄️open in new window 🔗open in new window
324摆动排序 II贪心 数组 分治 2+🟠🀄️open in new window 🔗open in new window
330按要求补齐数组贪心 数组🔴🀄️open in new window 🔗open in new window
334递增的三元子序列[✓]贪心 数组🟠🀄️open in new window 🔗open in new window
358K 距离间隔重排字符串 🔒贪心 哈希表 字符串 3+🔴🀄️open in new window 🔗open in new window
376摆动序列贪心 数组 动态规划🟠🀄️open in new window 🔗open in new window
397整数替换贪心 位运算 记忆化搜索 1+🟠🀄️open in new window 🔗open in new window
402移掉 K 位数字 贪心 字符串 1+🟠🀄️open in new window 🔗open in new window
409最长回文串贪心 哈希表 字符串🟢🀄️open in new window 🔗open in new window
410分割数组的最大值贪心 数组 二分查找 2+🔴🀄️open in new window 🔗open in new window
420强密码检验器贪心 字符串 堆(优先队列)🔴🀄️open in new window 🔗open in new window
435无重叠区间[✓]贪心 数组 动态规划 1+🟠🀄️open in new window 🔗open in new window
452用最少数量的箭引爆气球[✓]贪心 数组 排序🟠🀄️open in new window 🔗open in new window
455分发饼干贪心 数组 双指针 1+🟢🀄️open in new window 🔗open in new window
484寻找排列 🔒 贪心 数组 1+🟠🀄️open in new window 🔗open in new window
502IPO[✓]贪心 数组 排序 1+🔴🀄️open in new window 🔗open in new window
517超级洗衣机贪心 数组🔴🀄️open in new window 🔗open in new window
527单词缩写 🔒贪心 字典树 数组 2+🔴🀄️open in new window 🔗open in new window
555分割连接字符串 🔒贪心 数组 字符串🟠🀄️open in new window 🔗open in new window
561数组拆分贪心 数组 计数排序 1+🟢🀄️open in new window 🔗open in new window
581最短无序连续子数组 贪心 数组 3+🟠🀄️open in new window 🔗open in new window
605种花问题[✓]贪心 数组🟢🀄️open in new window 🔗open in new window
611有效三角形的个数[✓]贪心 数组 双指针 2+🟠🀄️open in new window 🔗open in new window
621任务调度器贪心 数组 哈希表 3+🟠🀄️open in new window 🔗open in new window
624数组列表中的最大距离贪心 数组🟠🀄️open in new window 🔗open in new window
625最小因式分解 🔒贪心 数学🟠🀄️open in new window 🔗open in new window
630课程表 III贪心 数组 排序 1+🔴🀄️open in new window 🔗open in new window
632最小区间[✓]贪心 数组 哈希表 3+🔴🀄️open in new window 🔗open in new window
646最长数对链贪心 数组 动态规划 1+🟠🀄️open in new window 🔗open in new window
649Dota2 参议院[✓]贪心 队列 字符串🟠🀄️open in new window 🔗open in new window
659分割数组为连续子序列贪心 数组 哈希表 1+🟠🀄️open in new window 🔗open in new window
670最大交换[✓]贪心 数学🟠🀄️open in new window 🔗open in new window
678有效的括号字符串[✓] 贪心 字符串 1+🟠🀄️open in new window 🔗open in new window
680验证回文串 II贪心 双指针 字符串🟢🀄️open in new window 🔗open in new window
714买卖股票的最佳时机含手续费[✓]贪心 数组 动态规划🟠🀄️open in new window 🔗open in new window
738单调递增的数字贪心 数学🟠🀄️open in new window 🔗open in new window
757设置交集大小至少为2贪心 数组 排序🔴🀄️open in new window 🔗open in new window
763划分字母区间[✓]贪心 哈希表 双指针 1+🟠🀄️open in new window 🔗open in new window
765情侣牵手贪心 深度优先搜索 广度优先搜索 2+🔴🀄️open in new window 🔗open in new window
767重构字符串贪心 哈希表 字符串 3+🟠🀄️open in new window 🔗open in new window
768最多能完成排序的块 II 贪心 数组 2+🔴🀄️open in new window 🔗open in new window
769最多能完成排序的块 贪心 数组 2+🟠🀄️open in new window 🔗open in new window
781森林中的兔子贪心 数组 哈希表 1+🟠🀄️open in new window 🔗open in new window
807保持城市天际线贪心 数组 矩阵🟠🀄️open in new window 🔗open in new window
826安排工作以达到最大收益贪心 数组 双指针 2+🟠🀄️open in new window 🔗open in new window
846一手顺子贪心 数组 哈希表 1+🟠🀄️open in new window 🔗open in new window
857雇佣 K 名工人的最低成本贪心 数组 排序 1+🔴🀄️open in new window 🔗open in new window
860柠檬水找零贪心 数组🟢🀄️open in new window 🔗open in new window
861翻转矩阵后的得分贪心 位运算 数组 1+🟠🀄️open in new window 🔗open in new window
870优势洗牌贪心 数组 双指针 1+🟠🀄️open in new window 🔗open in new window
871最低加油次数贪心 数组 动态规划 1+🔴🀄️open in new window 🔗open in new window
881救生艇贪心 数组 双指针 1+🟠🀄️open in new window 🔗open in new window
910最小差值 II贪心 数组 数学 1+🟠🀄️open in new window 🔗open in new window
921使括号有效的最少添加[✓] 贪心 字符串🟠🀄️open in new window 🔗open in new window
936戳印序列 贪心 队列 1+🔴🀄️open in new window 🔗open in new window
942增减字符串匹配贪心 数组 双指针 1+🟢🀄️open in new window 🔗open in new window
945使数组唯一的最小增量[✓]贪心 数组 计数 1+🟠🀄️open in new window 🔗open in new window
948令牌放置贪心 数组 双指针 1+🟠🀄️open in new window 🔗open in new window
954二倍数对数组[✓]贪心 数组 哈希表 1+🟠🀄️open in new window 🔗open in new window
955删列造序 II贪心 数组 字符串🟠🀄️open in new window 🔗open in new window
969煎饼排序贪心 数组 双指针 1+🟠🀄️open in new window 🔗open in new window
976三角形的最大周长贪心 数组 数学 1+🟢🀄️open in new window 🔗open in new window
984不含 AAA 或 BBB 的字符串贪心 字符串🟠🀄️open in new window 🔗open in new window
991坏了的计算器贪心 数学🟠🀄️open in new window 🔗open in new window
1005K 次取反后最大化的数组和贪心 数组 排序🟢🀄️open in new window 🔗open in new window
1007行相等的最少多米诺旋转贪心 数组🟠🀄️open in new window 🔗open in new window
1013将数组分成和相等的三个部分贪心 数组🟢🀄️open in new window 🔗open in new window
1024视频拼接贪心 数组 动态规划🟠🀄️open in new window 🔗open in new window
1029两地调度贪心 数组 排序🟠🀄️open in new window 🔗open in new window
1053交换一次的先前排列贪心 数组🟠🀄️open in new window 🔗open in new window
1054距离相等的条形码贪心 数组 哈希表 3+🟠🀄️open in new window 🔗open in new window
1055形成字符串的最短路径 🔒贪心 双指针 字符串 1+🟠🀄️open in new window 🔗open in new window
1057校园自行车分配 🔒贪心 数组 排序🟠🀄️open in new window 🔗open in new window
1058最小化舍入误差以满足目标 🔒贪心 数组 数学 2+🟠🀄️open in new window 🔗open in new window
1081不同字符的最小子序列[✓] 贪心 字符串 1+🟠🀄️open in new window 🔗open in new window
1090受标签影响的最大值贪心 数组 哈希表 2+🟠🀄️open in new window 🔗open in new window
1130叶值的最小代价生成树 贪心 数组 2+🟠🀄️open in new window 🔗open in new window
1144递减元素使数组呈锯齿状贪心 数组🟠🀄️open in new window 🔗open in new window
1147段式回文贪心 双指针 字符串 3+🔴🀄️open in new window 🔗open in new window
1167连接木棍的最低费用 🔒贪心 数组 堆(优先队列)🟠🀄️open in new window 🔗open in new window
1183矩阵中 1 的最大数量 🔒贪心 堆(优先队列)🔴🀄️open in new window 🔗open in new window
1196最多可以买到的苹果数量 🔒贪心 数组 排序🟢🀄️open in new window 🔗open in new window
1199建造街区的最短时间 🔒贪心 数组 数学 1+🔴🀄️open in new window 🔗open in new window
1217玩筹码贪心 数组 数学🟢🀄️open in new window 🔗open in new window
1221分割平衡字符串贪心 字符串 计数🟢🀄️open in new window 🔗open in new window
1247交换字符使得字符串相同贪心 数学 字符串🟠🀄️open in new window 🔗open in new window
1253重构 2 行二进制矩阵贪心 数组 矩阵🟠🀄️open in new window 🔗open in new window
1262可被三整除的最大和贪心 数组 动态规划 1+🟠🀄️open in new window 🔗open in new window
1282用户分组贪心 数组 哈希表🟠🀄️open in new window 🔗open in new window
1296划分数组为连续数字的集合贪心 数组 哈希表 1+🟠🀄️open in new window 🔗open in new window
13236 和 9 组成的最大数字贪心 数学🟢🀄️open in new window 🔗open in new window
1326灌溉花园的最少水龙头数目贪心 数组 动态规划🔴🀄️open in new window 🔗open in new window
1328破坏回文串贪心 字符串🟠🀄️open in new window 🔗open in new window
1330翻转子数组得到最大的数组值贪心 数组 数学🔴🀄️open in new window 🔗open in new window
1338数组大小减半贪心 数组 哈希表 2+🟠🀄️open in new window 🔗open in new window
1353最多可以参加的会议数目贪心 数组 排序 1+🟠🀄️open in new window 🔗open in new window
1363形成三的最大倍数贪心 数组 动态规划🔴🀄️open in new window 🔗open in new window
1382将二叉搜索树变平衡贪心 深度优先搜索 3+🟠🀄️open in new window 🔗open in new window
1383最大的团队表现值贪心 数组 排序 1+🔴🀄️open in new window 🔗open in new window
1386安排电影院座位贪心 位运算 数组 1+🟠🀄️open in new window 🔗open in new window
13883n 块披萨贪心 数组 动态规划 1+🔴🀄️open in new window 🔗open in new window
1400构造 K 个回文字符串贪心 哈希表 字符串 1+🟠🀄️open in new window 🔗open in new window
1402做菜顺序贪心 数组 动态规划 1+🔴🀄️open in new window 🔗open in new window
1403非递增顺序的最小子序列贪心 数组 排序🟢🀄️open in new window 🔗open in new window
1405最长快乐字符串[✓]贪心 字符串 堆(优先队列)🟠🀄️open in new window 🔗open in new window
1414和为 K 的最少斐波那契数字数目贪心 数学🟠🀄️open in new window 🔗open in new window
1432改变一个整数能得到的最大差值贪心 数学🟠🀄️open in new window 🔗open in new window
1433检查一个字符串是否可以打破另一个字符串贪心 字符串 排序🟠🀄️open in new window 🔗open in new window
1465切割后面积最大的蛋糕贪心 数组 排序🟠🀄️open in new window 🔗open in new window
1481不同整数的最少数目贪心 数组 哈希表 2+🟠🀄️open in new window 🔗open in new window
1488避免洪水泛滥贪心 数组 哈希表 2+🟠🀄️open in new window 🔗open in new window
1505最多 K 次交换相邻数位后得到的最小整数贪心 树状数组 线段树 1+🔴🀄️open in new window 🔗open in new window
1509三次操作后最大值与最小值的最小差贪心 数组 排序🟠🀄️open in new window 🔗open in new window
1520最多的不重叠子字符串贪心 字符串🔴🀄️open in new window 🔗open in new window
1526形成目标数组的子数组最少增加次数 贪心 数组 2+🔴🀄️open in new window 🔗open in new window
1529最少的后缀翻转次数贪心 字符串🟠🀄️open in new window 🔗open in new window
1536排布二进制网格的最少交换次数贪心 数组 矩阵🟠🀄️open in new window 🔗open in new window
1537最大得分贪心 数组 双指针 1+🔴🀄️open in new window 🔗open in new window
1541平衡括号字符串的最少插入次数 贪心 字符串🟠🀄️open in new window 🔗open in new window
1546和为目标值且不重叠的非空子数组的最大数目贪心 数组 哈希表 1+🟠🀄️open in new window 🔗open in new window
1558得到目标数组的最少函数调用次数贪心 位运算 数组🟠🀄️open in new window 🔗open in new window
1561你可以获得的最大硬币数目贪心 数组 数学 2+🟠🀄️open in new window 🔗open in new window
1564把箱子放进仓库里 I 🔒贪心 数组 排序🟠🀄️open in new window 🔗open in new window
1567乘积为正数的最长子数组长度贪心 数组 动态规划🟠🀄️open in new window 🔗open in new window
1578使绳子变成彩色的最短时间贪心 数组 字符串 1+🟠🀄️open in new window 🔗open in new window
1580把箱子放进仓库里 II 🔒贪心 数组 排序🟠🀄️open in new window 🔗open in new window
1585检查字符串是否可以通过排序子字符串得到另一个字符串贪心 字符串 排序🔴🀄️open in new window 🔗open in new window
1589所有排列中的最大和贪心 数组 前缀和 1+🟠🀄️open in new window 🔗open in new window
1605给定行和列的和求可行矩阵贪心 数组 矩阵🟠🀄️open in new window 🔗open in new window
1606找到处理最多请求的服务器贪心 数组 有序集合 1+🔴🀄️open in new window 🔗open in new window
1642可以到达的最远建筑贪心 数组 堆(优先队列)🟠🀄️open in new window 🔗open in new window
1647字符频次唯一的最小删除次数贪心 哈希表 字符串 1+🟠🀄️open in new window 🔗open in new window
1648销售价值减少的颜色球贪心 数组 数学 3+🟠🀄️open in new window 🔗open in new window
1663具有给定数值的最小字符串贪心 字符串🟠🀄️open in new window 🔗open in new window
1665完成所有任务的最少初始能量贪心 数组 排序🔴🀄️open in new window 🔗open in new window
1671得到山形数组的最少删除次数[✓]贪心 数组 二分查找 1+🔴🀄️open in new window 🔗open in new window
1673找出最具竞争力的子序列 贪心 数组 1+🟠🀄️open in new window 🔗open in new window
1675数组的最小偏移量贪心 数组 有序集合 1+🔴🀄️open in new window 🔗open in new window
1686石子游戏 VI贪心 数组 数学 3+🟠🀄️open in new window 🔗open in new window
1689十-二进制数的最少数目贪心 字符串🟠🀄️open in new window 🔗open in new window
1702修改后的最大二进制字符串贪心 字符串🟠🀄️open in new window 🔗open in new window
1703得到连续 K 个 1 的最少相邻交换次数贪心 数组 前缀和 1+🔴🀄️open in new window 🔗open in new window
1705吃苹果的最大数目贪心 数组 堆(优先队列)🟠🀄️open in new window 🔗open in new window
1708长度为 K 的最大子数组 🔒贪心 数组🟢🀄️open in new window 🔗open in new window
1710卡车上的最大单元数贪心 数组 排序🟢🀄️open in new window 🔗open in new window
1713得到子序列的最少操作次数贪心 数组 哈希表 1+🔴🀄️open in new window 🔗open in new window
1717删除子字符串的最大得分 贪心 字符串🟠🀄️open in new window 🔗open in new window
1727重新排列后的最大子矩阵贪心 数组 矩阵 1+🟠🀄️open in new window 🔗open in new window
1733需要教语言的最少人数贪心 数组 哈希表🟠🀄️open in new window 🔗open in new window
1736替换隐藏数字得到的最晚时间贪心 字符串🟢🀄️open in new window 🔗open in new window
1739放置盒子贪心 数学 二分查找🔴🀄️open in new window 🔗open in new window
1753移除石子的最大得分贪心 数学 堆(优先队列)🟠🀄️open in new window 🔗open in new window
1754构造字典序最大的合并字符串贪心 双指针 字符串🟠🀄️open in new window 🔗open in new window
1764通过连接另一个数组的子数组得到一个数组贪心 数组 双指针 1+🟠🀄️open in new window 🔗open in new window
1775通过最少操作次数使数组的和相等贪心 数组 哈希表 1+🟠🀄️open in new window 🔗open in new window
1785构成特定和需要添加的最少元素贪心 数组🟠🀄️open in new window 🔗open in new window
1788最大化花园的美观度 🔒贪心 数组 哈希表 1+🔴🀄️open in new window 🔗open in new window
1792最大平均通过率贪心 数组 堆(优先队列)🟠🀄️open in new window 🔗open in new window
1794统计距离最小的子串对个数 🔒贪心 哈希表 字符串🟠🀄️open in new window 🔗open in new window
1798你能构造出连续值的最大数目贪心 数组 排序🟠🀄️open in new window 🔗open in new window
1802有界数组中指定下标处的最大值贪心 二分查找🟠🀄️open in new window 🔗open in new window
1824最少侧跳次数贪心 数组 动态规划🟠🀄️open in new window 🔗open in new window
1827最少操作使数组递增贪心 数组🟢🀄️open in new window 🔗open in new window
1833雪糕的最大数量贪心 数组 计数排序 1+🟠🀄️open in new window 🔗open in new window
1838最高频元素的频数贪心 数组 二分查找 3+🟠🀄️open in new window 🔗open in new window
1846减小和重新排列数组后的最大元素贪心 数组 排序🟠🀄️open in new window 🔗open in new window
1850邻位交换的最小次数贪心 双指针 字符串🟠🀄️open in new window 🔗open in new window
1864构成交替字符串需要的最小交换次数贪心 字符串🟠🀄️open in new window 🔗open in new window
1874两个数组的最小乘积和 🔒贪心 数组 排序🟠🀄️open in new window 🔗open in new window
1877数组中最大数对和的最小值贪心 数组 双指针 1+🟠🀄️open in new window 🔗open in new window
1881插入后的最大值贪心 字符串🟠🀄️open in new window 🔗open in new window
1888使二进制字符串字符交替的最少反转次数贪心 字符串 动态规划 1+🟠🀄️open in new window 🔗open in new window
1899合并若干三元组以形成目标三元组贪心 数组🟠🀄️open in new window 🔗open in new window
1903字符串中的最大奇数贪心 数学 字符串🟢🀄️open in new window 🔗open in new window
1921消灭怪物的最大数量贪心 数组 排序🟠🀄️open in new window 🔗open in new window
1927求和游戏贪心 数学 字符串 1+🟠🀄️open in new window 🔗open in new window
1936新增的最少台阶数贪心 数组🟠🀄️open in new window 🔗open in new window
1946子字符串突变后可能得到的最大整数贪心 数组 字符串🟠🀄️open in new window 🔗open in new window
1953你可以工作的最大周数贪心 数组🟠🀄️open in new window 🔗open in new window
1962移除石子使总数最小贪心 数组 堆(优先队列)🟠🀄️open in new window 🔗open in new window
1963使字符串平衡的最小交换次数[✓] 贪心 双指针 1+🟠🀄️open in new window 🔗open in new window
1968构造元素不等于两相邻元素平均值的数组贪心 数组 排序🟠🀄️open in new window 🔗open in new window
1969数组元素的最小非零乘积贪心 递归 数学🟠🀄️open in new window 🔗open in new window
1974使用特殊打字机键入单词的最少时间贪心 字符串🟢🀄️open in new window 🔗open in new window
1975最大方阵和贪心 数组 矩阵🟠🀄️open in new window 🔗open in new window
1989捉迷藏中可捕获的最大人数 🔒贪心 数组🟠🀄️open in new window 🔗open in new window
1996游戏中弱角色的数量 贪心 数组 2+🟠🀄️open in new window 🔗open in new window
2007从双倍数组中还原原数组贪心 数组 哈希表 1+🟠🀄️open in new window 🔗open in new window
2014重复 K 次的最长子序列贪心 字符串 回溯 2+🔴🀄️open in new window 🔗open in new window
2015每段建筑物的平均高度 🔒贪心 数组 排序 1+🟠🀄️open in new window 🔗open in new window
2027转换字符串的最少操作次数贪心 字符串🟢🀄️open in new window 🔗open in new window
2029石子游戏 IX贪心 数组 数学 2+🟠🀄️open in new window 🔗open in new window
2030含特定字母的最小子序列 贪心 字符串 1+🔴🀄️open in new window 🔗open in new window
2037使每位学生都有座位的最少移动次数贪心 数组 计数排序 1+🟢🀄️open in new window 🔗open in new window
2038如果相邻两个颜色均相同则删除当前颜色贪心 数学 字符串 1+🟠🀄️open in new window 🔗open in new window
2071你可以安排的最多任务数目贪心 队列 数组 3+🔴🀄️open in new window 🔗open in new window
2078两栋颜色不同且距离最远的房子贪心 数组🟢🀄️open in new window 🔗open in new window
2086喂食仓鼠的最小食物桶数贪心 字符串 动态规划🟠🀄️open in new window 🔗open in new window
2087网格图中机器人回家的最小代价贪心 数组🟠🀄️open in new window 🔗open in new window
2091从数组中移除最大值和最小值贪心 数组🟠🀄️open in new window 🔗open in new window
2098长度为 K 的最大偶数和子序列 🔒贪心 数组 排序🟠🀄️open in new window 🔗open in new window
2116判断一个括号字符串是否有效 贪心 字符串🟠🀄️open in new window 🔗open in new window
2126摧毁小行星贪心 数组 排序🟠🀄️open in new window 🔗open in new window
2131连接两字母单词得到的最长回文串贪心 数组 哈希表 2+🟠🀄️open in new window 🔗open in new window
2132用邮票贴满网格图贪心 数组 矩阵 1+🔴🀄️open in new window 🔗open in new window
2136全部开花的最早一天贪心 数组 排序🔴🀄️open in new window 🔗open in new window
2139得到目标值的最少行动次数贪心 数学🟠🀄️open in new window 🔗open in new window
2141同时运行 N 台电脑的最长时间贪心 数组 二分查找 1+🔴🀄️open in new window 🔗open in new window
2144打折购买糖果的最小开销贪心 数组 排序🟢🀄️open in new window 🔗open in new window
2160拆分数位后四位数字的最小和贪心 数学 排序🟢🀄️open in new window 🔗open in new window
2170使数组变成交替数组的最少操作数贪心 数组 哈希表 1+🟠🀄️open in new window 🔗open in new window
2171拿出最少数目的魔法豆贪心 数组 枚举 2+🟠🀄️open in new window 🔗open in new window
2178拆分成最多数目的正偶数之和贪心 数学 回溯🟠🀄️open in new window 🔗open in new window
2182构造限制重复的字符串贪心 哈希表 字符串 2+🟠🀄️open in new window 🔗open in new window
2193得到回文串的最少操作次数贪心 树状数组 双指针 1+🔴🀄️open in new window 🔗open in new window
2195向数组中追加 K 个整数贪心 数组 数学 1+🟠🀄️open in new window 🔗open in new window
2202K 次操作后最大化顶端元素贪心 数组🟠🀄️open in new window 🔗open in new window
2207字符串中最多数目的子序列贪心 字符串 前缀和🟠🀄️open in new window 🔗open in new window
2208将数组和减半的最少操作次数贪心 数组 堆(优先队列)🟠🀄️open in new window 🔗open in new window
2214通关游戏所需的最低生命值 🔒贪心 数组🟠🀄️open in new window 🔗open in new window
2216美化数组的最少删除数 贪心 数组🟠🀄️open in new window 🔗open in new window
2224转化时间需要的最少操作数贪心 字符串🟢🀄️open in new window 🔗open in new window
2233K 次增加后的最大乘积贪心 数组 堆(优先队列)🟠🀄️open in new window 🔗open in new window
2234花园的最大总美丽值贪心 数组 双指针 2+🔴🀄️open in new window 🔗open in new window
2241设计一个 ATM 机器贪心 设计 数组🟠🀄️open in new window 🔗open in new window
2244完成所有任务需要的最少轮数贪心 数组 哈希表 1+🟠🀄️open in new window 🔗open in new window
2259移除指定数字得到的最大结果[✓]贪心 字符串 枚举🟢🀄️open in new window 🔗open in new window
2263数组变为有序的最小操作次数 🔒贪心 动态规划🔴🀄️open in new window 🔗open in new window
2268最少按键次数 🔒贪心 哈希表 字符串 2+🟠🀄️open in new window 🔗open in new window
2271毯子覆盖的最多白色砖块数贪心 数组 二分查找 2+🟠🀄️open in new window 🔗open in new window
2279装满石头的背包的最大数量贪心 数组 排序🟠🀄️open in new window 🔗open in new window
2285道路的最大总重要性贪心 排序 1+🟠🀄️open in new window 🔗open in new window
2294划分数组使最大差为 K贪心 数组 排序🟠🀄️open in new window 🔗open in new window
2310个位数字为 K 的整数之和贪心 数学 动态规划 1+🟠🀄️open in new window 🔗open in new window
2311小于等于 K 的最长二进制子序列贪心 记忆化搜索 字符串 1+🟠🀄️open in new window 🔗open in new window
2323完成所有工作的最短时间 II 🔒贪心 数组 排序🟠🀄️open in new window 🔗open in new window
2333最小差值平方和贪心 数组 二分查找 2+🟠🀄️open in new window 🔗open in new window
2335装满杯子需要的最短总时长贪心 数组 排序 1+🟢🀄️open in new window 🔗open in new window
2340生成有效数组的最少交换次数 🔒贪心 数组🟠🀄️open in new window 🔗open in new window
2350不可能得到的最短骰子序列贪心 数组 哈希表🔴🀄️open in new window 🔗open in new window
2357使数组中所有元素都等于零贪心 数组 哈希表 3+🟢🀄️open in new window 🔗open in new window
2358分组的最大数量贪心 数组 数学 1+🟠🀄️open in new window 🔗open in new window
2366将数组排序的最少替换次数贪心 数组 数学🔴🀄️open in new window 🔗open in new window
2375根据模式串构造最小数字 贪心 字符串 1+🟠🀄️open in new window 🔗open in new window
2383赢得比赛需要的最少训练时长贪心 数组🟢🀄️open in new window 🔗open in new window
2384最大回文数字贪心 哈希表 字符串 1+🟠🀄️open in new window 🔗open in new window
2389和有限的最长子序列贪心 数组 二分查找 2+🟢🀄️open in new window 🔗open in new window
2405子字符串的最优划分贪心 哈希表 字符串🟠🀄️open in new window 🔗open in new window
2406将区间分为最少组数[✓]贪心 数组 双指针 3+🟠🀄️open in new window 🔗open in new window
2410运动员和训练师的最大匹配数贪心 数组 双指针 1+🟠🀄️open in new window 🔗open in new window
2412完成所有交易的初始最少钱数贪心 数组 排序🔴🀄️open in new window 🔗open in new window
2422使用合并操作将数组转换为回文序列 🔒贪心 数组 双指针🟠🀄️open in new window 🔗open in new window
2429最小异或贪心 位运算🟠🀄️open in new window 🔗open in new window
2434使用机器人打印字典序最小的字符串 贪心 哈希表 1+🟠🀄️open in new window 🔗open in new window
2436使子数组最大公约数大于一的最小分割数 🔒贪心 数组 数学 2+🟠🀄️open in new window 🔗open in new window
2439最小化数组中的最大值贪心 数组 二分查找 2+🟠🀄️open in new window 🔗open in new window
2448使数组相等的最小开销贪心 数组 二分查找 2+🔴🀄️open in new window 🔗open in new window
2449使数组相似的最少操作次数贪心 数组 排序🔴🀄️open in new window 🔗open in new window
2457美丽整数的最小增量贪心 数学🟠🀄️open in new window 🔗open in new window
2459通过移动项目到空白区域来排序数组 🔒贪心 数组 排序🔴🀄️open in new window 🔗open in new window
2472不重叠回文子字符串的最大数目贪心 双指针 字符串 1+🔴🀄️open in new window 🔗open in new window
2486追加字符以获得子序列贪心 双指针 字符串🟠🀄️open in new window 🔗open in new window
2497图中最大星和贪心 数组 2+🟠🀄️open in new window 🔗open in new window
2498青蛙过河 II贪心 数组 二分查找🟠🀄️open in new window 🔗open in new window
2499让数组不相等的最小总代价贪心 数组 哈希表 1+🔴🀄️open in new window 🔗open in new window
2517礼盒的最大甜蜜度贪心 数组 二分查找 1+🟠🀄️open in new window 🔗open in new window
2522将字符串分割成值不超过 K 的子字符串贪心 字符串 动态规划🟠🀄️open in new window 🔗open in new window
2528最大化城市的最小电量贪心 队列 数组 3+🔴🀄️open in new window 🔗open in new window
2530执行 K 次操作后的最大分数[✓]贪心 数组 堆(优先队列)🟠🀄️open in new window 🔗open in new window
2541使数组中所有元素相等的最小操作数 II贪心 数组 数学🟠🀄️open in new window 🔗open in new window
2542最大子序列的分数贪心 数组 排序 1+🟠🀄️open in new window 🔗open in new window
2548填满背包的最大价格 🔒贪心 数组 排序🟠🀄️open in new window 🔗open in new window
2551将珠子放入背包中贪心 数组 排序 1+🔴🀄️open in new window 🔗open in new window
2554从一个范围内选择最多整数 I贪心 数组 哈希表 2+🟠🀄️open in new window 🔗open in new window
2557从一个范围内选择最多整数 II 🔒贪心 数组 二分查找 1+🟠🀄️open in new window 🔗open in new window
2561重排水果贪心 数组 哈希表🔴🀄️open in new window 🔗open in new window
2566替换一个数字后的最大差值贪心 数学🟢🀄️open in new window 🔗open in new window
2567修改两个元素的最小分数贪心 数组 排序🟠🀄️open in new window 🔗open in new window
2571将整数减少到零需要的最少操作数贪心 位运算 动态规划🟠🀄️open in new window 🔗open in new window
2573找出对应 LCP 矩阵的字符串贪心 并查集 数组 3+🔴🀄️open in new window 🔗open in new window
2576求出最多标记下标贪心 数组 双指针 2+🟠🀄️open in new window 🔗open in new window
2578最小和分割贪心 数学 排序🟢🀄️open in new window 🔗open in new window
2587重排数组以得到最大前缀分数贪心 数组 前缀和 1+🟠🀄️open in new window 🔗open in new window
2589完成所有任务的最少时间 贪心 数组 2+🔴🀄️open in new window 🔗open in new window
2591将钱分给最多的儿童贪心 数学🟢🀄️open in new window 🔗open in new window
2592最大化数组的伟大值贪心 数组 双指针 1+🟠🀄️open in new window 🔗open in new window
2598执行操作后的最大 MEX贪心 数组 哈希表 1+🟠🀄️open in new window 🔗open in new window
2599使前缀和数组非负 🔒贪心 数组 堆(优先队列)🟠🀄️open in new window 🔗open in new window
2600K 件物品的最大和贪心 数学🟢🀄️open in new window 🔗open in new window
2601质数减法运算[✓]贪心 数组 数学 2+🟠🀄️open in new window 🔗open in new window
2611老鼠和奶酪贪心 数组 排序 1+🟠🀄️open in new window 🔗open in new window
2616最小化数对的最大差值贪心 数组 二分查找🟠🀄️open in new window 🔗open in new window
2645构造有效字符串的最少插入数 贪心 字符串 1+🟠🀄️open in new window 🔗open in new window
2656K 个元素的最大和贪心 数组🟢🀄️open in new window 🔗open in new window
2659将数组清空贪心 树状数组 线段树 4+🔴🀄️open in new window 🔗open in new window
2663字典序最小的美丽字符串贪心 字符串🔴🀄️open in new window 🔗open in new window
2673使二叉树所有路径值相等的最小代价贪心 数组 2+🟠🀄️open in new window 🔗open in new window
2680最大或值贪心 位运算 数组 1+🟠🀄️open in new window 🔗open in new window
2697字典序最小回文串贪心 双指针 字符串🟢🀄️open in new window 🔗open in new window
2706购买两块巧克力贪心 数组 排序🟢🀄️open in new window 🔗open in new window
2708一个小组的最大实力值贪心 位运算 数组 4+🟠🀄️open in new window 🔗open in new window
2712使所有字符相等的最小成本贪心 字符串 动态规划🟠🀄️open in new window 🔗open in new window
2734执行子串操作后的字典序最小字符串贪心 字符串🟠🀄️open in new window 🔗open in new window
2745构造最长的新字符串贪心 脑筋急转弯 数学 1+🟠🀄️open in new window 🔗open in new window
2789合并后数组中的最大元素贪心 数组🟠🀄️open in new window 🔗open in new window
2790长度递增组的最大数目贪心 数组 数学 2+🔴🀄️open in new window 🔗open in new window
2800包含三个字符串的最短字符串贪心 字符串 枚举🟠🀄️open in new window 🔗open in new window
2811判断是否能拆分数组贪心 数组 动态规划🟠🀄️open in new window 🔗open in new window
2813子序列最大优雅度 贪心 数组 3+🔴🀄️open in new window 🔗open in new window
2818操作使得分最大 贪心 数组 3+🔴🀄️open in new window 🔗open in new window
2829k-avoiding 数组的最小总和贪心 数学🟠🀄️open in new window 🔗open in new window
2834找出美丽数组的最小和贪心 数学🟠🀄️open in new window 🔗open in new window
2835使子序列的和等于目标的最少操作次数贪心 位运算 数组🔴🀄️open in new window 🔗open in new window
2842统计一个字符串的 k 子序列美丽值最大的数目贪心 哈希表 数学 2+🔴🀄️open in new window 🔗open in new window
2844生成特殊数字的最少操作贪心 数学 字符串 1+🟠🀄️open in new window 🔗open in new window
2847给定数字乘积的最小数字 🔒贪心 数学🟠🀄️open in new window 🔗open in new window
2856删除数对后的最小数组长度贪心 数组 哈希表 3+🟠🀄️open in new window 🔗open in new window
2864最大二进制奇数贪心 数学 字符串🟢🀄️open in new window 🔗open in new window
2868单词游戏 🔒贪心 数组 数学 3+🔴🀄️open in new window 🔗open in new window
2870使数组为空的最少操作次数贪心 数组 哈希表 1+🟠🀄️open in new window 🔗open in new window
2871将数组分割成最多数目的子数组贪心 位运算 数组🟠🀄️open in new window 🔗open in new window
2892将相邻元素相乘后得到最小化数组 🔒贪心 数组 动态规划🟠🀄️open in new window 🔗open in new window
2895最小处理时间贪心 数组 排序🟠🀄️open in new window 🔗open in new window
2897对数组执行操作使平方和最大贪心 位运算 数组 1+🔴🀄️open in new window 🔗open in new window
2900最长相邻不相等子序列 I贪心 数组 字符串 1+🟢🀄️open in new window 🔗open in new window
2910合法分组的最少组数贪心 数组 哈希表🟠🀄️open in new window 🔗open in new window
2918数组的最小相等和贪心 数组🟠🀄️open in new window 🔗open in new window
2931购买物品的最大开销贪心 数组 矩阵 2+🔴🀄️open in new window 🔗open in new window
2938区分黑球与白球[✓]贪心 双指针 字符串🟠🀄️open in new window 🔗open in new window
2939最大异或乘积贪心 位运算 数学🟠🀄️open in new window 🔗open in new window
2952需要添加的硬币的最小数量贪心 数组 排序🟠🀄️open in new window 🔗open in new window
2957消除相邻近似相等字符贪心 字符串 动态规划🟠🀄️open in new window 🔗open in new window
2966划分数组并满足最大差限制贪心 数组 排序🟠🀄️open in new window 🔗open in new window
2967使数组成为等数数组的最小代价贪心 数组 数学 2+🟠🀄️open in new window 🔗open in new window
2971找到最大周长的多边形贪心 数组 前缀和 1+🟠🀄️open in new window 🔗open in new window
3002移除后集合的最多元素数贪心 数组 哈希表🟠🀄️open in new window 🔗open in new window
3012通过操作使数组长度最小贪心 数组 数学 1+🟠🀄️open in new window 🔗open in new window
3014输入单词需要的最少按键次数 I贪心 数学 字符串🟢🀄️open in new window 🔗open in new window
3016输入单词需要的最少按键次数 II贪心 哈希表 字符串 2+🟠🀄️open in new window 🔗open in new window
3022给定操作次数内使剩余元素的或值最小贪心 位运算 数组🔴🀄️open in new window 🔗open in new window
3035回文字符串的最大数量贪心 数组 哈希表 3+🟠🀄️open in new window 🔗open in new window
3049标记所有下标的最早秒数 II贪心 数组 二分查找 1+🔴🀄️open in new window 🔗open in new window
3068最大节点价值之和贪心 位运算 3+🔴🀄️open in new window 🔗open in new window
3074重新分装苹果贪心 数组 排序🟢🀄️open in new window 🔗open in new window
3075幸福值最大化的选择方案贪心 数组 排序🟠🀄️open in new window 🔗open in new window
3081替换字符串中的问号使分数最小贪心 哈希表 字符串 3+🟠🀄️open in new window 🔗open in new window
3085成为 K 特殊字符串需要删除的最少字符数贪心 哈希表 字符串 2+🟠🀄️open in new window 🔗open in new window
3086拾起 K 个 1 需要的最少行动次数贪心 数组 前缀和 1+🔴🀄️open in new window 🔗open in new window
3088使字符串反回文 🔒贪心 字符串 计数排序 1+🔴🀄️open in new window 🔗open in new window
3091执行操作使数据元素之和大于等于 K贪心 数学 枚举🟠🀄️open in new window 🔗open in new window
3106满足距离约束且字典序最小的字符串贪心 字符串🟠🀄️open in new window 🔗open in new window
3107使数组中位数等于 K 的最少操作数贪心 数组 排序🟠🀄️open in new window 🔗open in new window
3111覆盖所有点的最少矩形数目贪心 数组 排序🟠🀄️open in new window 🔗open in new window
3119最大数量的可修复坑洼 🔒贪心 字符串 排序🟠🀄️open in new window 🔗open in new window
3125使得按位与结果为 0 的最大数字 🔒贪心 字符串 排序🟠🀄️open in new window 🔗open in new window
3139使数组中所有元素相等的最小开销贪心 数组 枚举🔴🀄️open in new window 🔗open in new window
3170删除星号以后字典序最小的字符串 贪心 哈希表 2+🟠🀄️open in new window 🔗open in new window
3189得到一个和平棋盘的最少步骤 🔒贪心 数组 计数排序 1+🟠🀄️open in new window 🔗open in new window
3192使二进制数组全部等于 1 的最少操作次数 II贪心 数组 动态规划🟠🀄️open in new window 🔗open in new window
3205最大数组跳跃得分 I 🔒 贪心 数组 2+🟠🀄️open in new window 🔗open in new window
3207与敌人战斗后的最大分数贪心 数组🟠🀄️open in new window 🔗open in new window
3216交换后字典序最小的字符串贪心 字符串🟢🀄️open in new window 🔗open in new window
3218切蛋糕的最小总开销 I贪心 数组 动态规划 1+🟠🀄️open in new window 🔗open in new window
3219切蛋糕的最小总开销 II贪心 数组 排序🔴🀄️open in new window 🔗open in new window
3221最大数组跳跃得分 II 🔒 贪心 数组 1+🟠🀄️open in new window 🔗open in new window
3228将 1 移动到末尾的最大操作次数贪心 字符串 计数🟠🀄️open in new window 🔗open in new window
3229使数组等于目标数组所需的最少操作次数 贪心 数组 2+🔴🀄️open in new window 🔗open in new window
3244新增道路查询后的最短距离 II贪心 数组 1+🔴🀄️open in new window 🔗open in new window
3260找出最大的 N 位 K 回文数贪心 数学 字符串 2+🔴🀄️open in new window 🔗open in new window
3273对 Bob 造成的最少伤害贪心 数组 排序🔴🀄️open in new window 🔗open in new window
3281范围内整数的最大得分贪心 数组 二分查找 1+🟠🀄️open in new window 🔗open in new window
3282到达数组末尾的最大得分贪心 数组🟠🀄️open in new window 🔗open in new window
3296移山所需的最少秒数贪心 数组 数学 2+🟠🀄️open in new window 🔗open in new window
3301高度互不相同的最大塔高和贪心 数组 排序🟠🀄️open in new window 🔗open in new window
3302字典序最小的合法序列贪心 双指针 字符串 1+🟠🀄️open in new window 🔗open in new window
3326使数组非递减的最少除法操作次数贪心 数组 数学 1+🟠🀄️open in new window 🔗open in new window
LCP 15游乐园的迷宫贪心 几何 数组 1+🔴🀄️open in new window
LCP 30魔塔游戏贪心 数组 堆(优先队列)🟠🀄️open in new window
LCP 32批量处理任务贪心 数组 堆(优先队列)🔴🀄️open in new window
LCP 33蓄水贪心 数组 堆(优先队列)🟢🀄️open in new window
LCP 37最小矩形面积贪心 几何 数组 3+🔴🀄️open in new window
LCP 40心算挑战贪心 数组 排序🟢🀄️open in new window
LCS 01下载插件贪心 数学 动态规划🟢🀄️open in new window
LCS 02完成一半题目贪心 数组 哈希表 1+🟢🀄️open in new window
剑指 Offer 45把数组排成最小的数[✓]贪心 字符串 排序🟠🀄️open in new window
剑指 Offer II 19最多删除一个字符得到回文贪心 双指针 字符串🟢🀄️open in new window
面试题 10.11峰与谷贪心 数组 排序🟠🀄️open in new window
面试题 16.16部分排序 贪心 数组 3+🟠🀄️open in new window