class Solution:

    def minSubsequence(self, nums):
        s = sum(nums)
        nums.sort(reverse=True)
        t = 0
        ret = []
        for i in nums:
            t += i
            s -= i
            ret.append(i)
            if t > s:
                return ret


sol = Solution()
nums = [4, 3, 10, 9, 8]
print(sol.minSubsequence(nums))

4d5cb721e5d6a62703b0818fe1b893df2d0ef27e
class Solution:
    <mask token>


<mask token>

class Solution:

    def minSubsequence(self, nums):
        s = sum(nums)
        nums.sort(reverse=True)
        t = 0
        ret = []
        for i in nums:
            t += i
            s -= i
            ret.append(i)
            if t > s:
                return ret


<mask token>

class Solution:

    def minSubsequence(self, nums):
        s = sum(nums)
        nums.sort(reverse=True)
        t = 0
        ret = []
        for i in nums:
            t += i
            s -= i
            ret.append(i)
            if t > s:
                return ret


<mask token>
print(sol.minSubsequence(nums))

class Solution:

    def minSubsequence(self, nums):
        s = sum(nums)
        nums.sort(reverse=True)
        t = 0
        ret = []
        for i in nums:
            t += i
            s -= i
            ret.append(i)
            if t > s:
                return ret


sol = Solution()
nums = [4, 3, 10, 9, 8]
print(sol.minSubsequence(nums))
