Max Prefix || Sorting || C++  
Complexity
Time complexity:O(N)

Space complexity:O(1)
Code

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

- Space complexity:O(1)
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```cpp []
class Solution {
public:
    int maxScore(vector<int>& nums) {
    sort(nums.begin(), nums.end(), greater<int>()); 

    long long sum = 0;
    int count = 0; 

    for (int i = 0; i < nums.size(); i++) {
        sum += nums[i];
        if (sum > 0) count++; 
        else break; 
    }

    return count;
}
};
```
['Greedy', 'Sorting', 'Prefix Sum', 'C++']