Prefix Sum of Sorted Array
Python 3\npython\nclass Solution:\n    def maxScore(self, nums: List[int]) -> int:\n        return sum(n > 0 for n in accumulate(sorted(nums, reverse=True)))\n\
**Python 3**\n```python\nclass Solution:\n    def maxScore(self, nums: List[int]) -> int:\n        return sum(n > 0 for n in accumulate(sorted(nums, reverse=True)))\n```\n**C++**\n```cpp\nint maxScore(vector<int>& n) {\n    sort(begin(n), end(n), greater<>());\n    for (long long sum = 0, i = 0; i <= n.size(); sum += n[i++])\n        if (i == n.size() || sum + n[i] <= 0)\n            return i;\n    return 0;\n}\n```
['C', 'Python3']