C++ || SIMPLE || EASY TO UNDERSTAND
Code\n\nclass Solution {\npublic:\n    bool static cmp(int &a,int &b){\n        return a>b;\n    }\n    int maxScore(vector<int>& nums) {\n        long long int
# Code\n```\nclass Solution {\npublic:\n    bool static cmp(int &a,int &b){\n        return a>b;\n    }\n    int maxScore(vector<int>& nums) {\n        long long int x = 0;\n        int y = 0;\n        sort(nums.begin(),nums.end(),cmp);\n        if(nums[0]<=0)return 0;\n        for(auto &i: nums){\n            x += i;\n            if(x<=0){\n                return y;\n            }\n            y++;\n        }\n        return y;\n    }\n};\n```
['Array', 'Greedy', 'Sorting', 'C++']