You are given an integer array nums and an integer k.
Choose at most k distinct elements from nums such that their sum is maximized.
Return an array containing the selected elements sorted in strictly descending order.
Constraints:
nums.length
nums[i]
k nums.length
You are given an integer array nums and an integer k.
Choose at most k distinct elements from nums such that their sum is maximized.
Return an array containing the selected elements sorted in strictly descending order.
Constraints:
nums.length
nums[i]
k nums.length