1403. Minimum Subsequence in Non-Increasing Order
On This Page
class Solution:
def minSubsequence(self, nums: List[int]) -> List[int]:
res = []
s, t = sum(nums), 0
for x in sorted(nums, reverse=True):
t += x
res.append(x)
if t > s - t:
break
return res