greedy || sorting || very easy to understand || must see ||
Code\n\nstatic int fast_io = []() \n{ \n    std::ios::sync_with_stdio(false); \n    cin.tie(nullptr); \n    cout.tie(nullptr); \n    return 0; \n}();\n\n#ifdef 
# Code\n```\nstatic int fast_io = []() \n{ \n    std::ios::sync_with_stdio(false); \n    cin.tie(nullptr); \n    cout.tie(nullptr); \n    return 0; \n}();\n\n#ifdef LOCAL\n    freopen("input.txt", "r" , stdin);\n    freopen("output.txt", "w", stdout);\n#endif\n\nclass Solution {\npublic:\n    int maxScore(vector<int>& nums) \n    {\n        //to count the numbe of positive integers in the nums\n        int count = 0;\n\n        //making the prefix vector to hold the final ans\n        vector<long long int>prefix(nums.size());    \n\n        //sorting the nums in greater<int>()\n        sort(nums.begin(),nums.end(),greater<int>());\n\n        if(nums[0] <= 0)\n        return 0;\n\n        count++;\n        prefix[0] = nums[0];\n\n        for(int i=1;i<nums.size();i++)\n        {\n            prefix[i] = prefix[i-1] + nums[i];\n            if(prefix[i] > 0) count++;\n        }\n        return count;\n    }\n};\n```
['Array', 'Greedy', 'Sorting', 'Prefix Sum', 'C++']