simple one for loop code 
Intuitionwe just first iterate and reverse it and then keep on checking the sum is greater than 0 or not if not then break else cnt++ and at the end return this
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
we just first iterate and reverse it and then keep on checking the sum is greater than 0 or not if not then break else cnt++ and at the end return this cnt. 

# Approach
<!-- Describe your approach to solving the problem. -->


# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->
O(nlog n) will be the time complexity. 

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->
No exxtra space is used that's why space complexity will be O(1).

# Code
```cpp []
class Solution {
public:
    int maxScore(vector<int>& nums) {
        long long  s = 0;
        sort(nums.begin(), nums.end());
        reverse(nums.begin(), nums.end());
        int cnt = 0;
        for (int i = 0; i < nums.size(); i++) {
            s += nums[i];
            if (s > 0) {
                cnt++;
            }
            else {
                break;
            }
        }

        return cnt;
    }
};
```
['C++']