Easy sol^n
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\n bool compare(int a,int b)\n{\n    if(a>b)\n    return true;\n    else\n    return false;     \n}\nclass Solution {\npublic:\n    int maxScore(vector<int>& nums) {\n       sort(nums.begin(),nums.end(),compare);\n       long long sum=0;\n       int c=0;\n       for(int i=0;i<nums.size();i++)\n       {\n           if(nums[i]>0)\n           {\n            sum+=(long long)nums[i];\n            c++;\n           }\n           else\n           {\n            if((sum-abs((long long)nums[i]))>0)\n            {\n                c++;\n                sum=sum-abs((long long)nums[i]);\n            }\n            else\n            break;\n           }\n       }\n       return c;\n    }\n};\n```
['Array', 'Greedy', 'Sorting', 'Prefix Sum', 'C++']