LeetCode --- 1403. Minimum Subsequence in Non-Increasing Order 解题报告
Posted 杨鑫newlfe
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了LeetCode --- 1403. Minimum Subsequence in Non-Increasing Order 解题报告相关的知识,希望对你有一定的参考价值。
Given the array nums
, obtain a subsequence of the array whose sum of elements is strictly greater than the sum of the non included elements in such subsequence.
If there are multiple solutions, return the subsequence with minimum size and if there still exist multiple solutions, return the subsequence with the maximum total sum of all its elements. A subsequence of an array can be obtained by erasing some (possibly zero) elements from the array.
Note that the solution with the given constraints is guaranteed to be unique. Also return the answer sorted in non-increasing order.
Example 1:
Input: nums = [4,3,10,9,8] Output: [10,9] Explanation: The subsequences [10,9] and [10,8] are minimal such that the sum of their elements is strictly greater than the sum of elements not
以上是关于LeetCode --- 1403. Minimum Subsequence in Non-Increasing Order 解题报告的主要内容,如果未能解决你的问题,请参考以下文章
LeetCode 1403 非递增顺序的最小子序列[贪心] HERODING的LeetCode之路
LeetCode Algorithm 1403. 非递增顺序的最小子序列
LeetCode Algorithm 1403. 非递增顺序的最小子序列
LeetCode Algorithm 1403. 非递增顺序的最小子序列
LeetCode --- 1403. Minimum Subsequence in Non-Increasing Order 解题报告