Given an integer array nums, obtain a subsequence such that the total sum of its elements is strictly greater than the sum of all elements not included in the subsequence.
If multiple such subsequences exist, return one with the minimum number of elements. If multiple minimum size subsequences satisfy the condition, return the one with the maximum total sum.
The resulting subsequence must be returned in non increasing order.
Note: A subsequence of an array is a sequence that can be derived from the array by deleting zero or more elements without changing the order of the remaining elements.
Constraints:
nums.length
nums[i]
Given an integer array nums, obtain a subsequence such that the total sum of its elements is strictly greater than the sum of all elements not included in the subsequence.
If multiple such subsequences exist, return one with the minimum number of elements. If multiple minimum size subsequences satisfy the condition, return the one with the maximum total sum.
The resulting subsequence must be returned in non increasing order.
Note: A subsequence of an array is a sequence that can be derived from the array by deleting zero or more elements without changing the order of the remaining elements.
Constraints:
nums.length
nums[i]