✅ Sort + Pre Sum || Faster 100% || 2 lines
c++\nclass Solution {\npublic:\n    int maxScore(vector<int>& nums, int res = 0, long long pre = 0) {\n        sort(nums.begin(), nums.end(), greater<int>());\n
```c++\nclass Solution {\npublic:\n    int maxScore(vector<int>& nums, int res = 0, long long pre = 0) {\n        sort(nums.begin(), nums.end(), greater<int>());\n        for (auto num: nums) pre += num, res += pre > 0;\n        return res;\n    }\n};\n```\n\n**For more solutions, check out this \uD83C\uDFC6  [GITHUB REPOSITORY](https://github.com/MuhtasimTanmoy/playground) with over 1500+ solutions.**
[]