1403. Minimum Subsequence in Non-Increasing Order
Description
**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 included, however, the subsequence [10,9] has the maximum total sum of its elements.
**Input:** nums = [4,4,7,6,7]
**Output:** [7,7,6]
**Explanation:** The subsequence [7,7] has the sum of its elements equal to 14 which is not strictly greater than the sum of elements not included (14 = 4 + 4 + 6). Therefore, the subsequence [7,6,7] is the minimal satisfying the conditions. Note the subsequence has to returned in non-decreasing order.
**Input:** nums = [6]
**Output:** [6]ac
Previous1402. Reducing DishesNext1404. Number of Steps to Reduce a Number in Binary Representation to One
Last updated