Sorting
\n# Approach\n Describe your approach to solving the problem. \nWe just need to sort the array in Decsesing order after that \nWe will add all elements to the s
\n# Approach\n<!-- Describe your approach to solving the problem. -->\nWe just need to sort the array in Decsesing order after that \nWe will add all elements to the sum now we just need to check \nWhen the sum becomes 0 or less than zero after that there is no need to check beccause it can never become maximum soln \nwe return count\n\n\n# Code\n```\nclass Solution:\n    def maxScore(self, nums: List[int]) -> int:\n        nums.sort(reverse=True)\n        sum=count=0\n        for i in nums:\n            sum+=i\n            if(sum<=0):\n                return count\n            else:\n                count+=1\n\n        return count\n```
['Python3']