Image Explanation🏆-[Sort + Positive Sum] - Complete Intuition
Video Solution\nhttps://youtu.be/_RzI3dDSdZA\n\n# Approach & Intuition\n\n\n\n\n# Code\n\n#define ll long long int\n\nclass Solution {\npublic:\n    int maxScor
# Video Solution\nhttps://youtu.be/_RzI3dDSdZA\n\n# Approach & Intuition\n![image.png](https://assets.leetcode.com/users/images/3d221e11-8289-4bb2-9caf-1100bf9867e0_1678594617.1362967.png)\n![image.png](https://assets.leetcode.com/users/images/076aa7ae-85b7-4b75-86c9-db7378d09de9_1678594624.92394.png)\n\n\n# Code\n```\n#define ll long long int\n\nclass Solution {\npublic:\n    int maxScore(vector<int>& nums) {\n        sort(nums.begin(), nums.end(), greater<int>());\n        int n = nums.size();\n        \n        vector<ll> prefix(n);\n        prefix[0] = nums[0];\n        \n        for(int i=1;i<n;i++){\n            prefix[i] = prefix[i-1] + nums[i];\n        }\n        \n        int ans = 0;\n        for(int i=0;i<n;i++){\n            if(prefix[i]>0ll)\n                ans++;\n        }\n        \n        return ans;\n    }\n};\n```
['C++']