![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
贪心算法
决定要好好毒树的Lucifer
这个作者很懒,什么都没留下…
展开
-
贪心法:LeetCode561 - 数组拆分(简单)
题目描述:Given an integer array nums of 2n integers, group these integers into n pairs (a1, b1), (a2, b2), ..., (an, bn) such that the sum of min(ai, bi) for all i is maximized. Return the maximized sum.给定长度为 2n 的整数数组 nums ,你的任务是将这些数分成 n 对, 例如 (a1, b1), (a原创 2022-02-13 17:30:43 · 590 阅读 · 0 评论 -
贪心法:LeetCode1218 - 最长定差子序列
题目:Given an integer array arr and an integer difference, return the length of the longest subsequence in arr which is an arithmetic sequence such that the difference between adjacent elements in the subsequence equals difference.A subsequence is a sequ原创 2022-02-13 19:58:23 · 369 阅读 · 0 评论