Simple code|| sorting
Connect with me on LinkedIn https://www.linkedin.com/in/raghav-upadhyay-80336b229/\n\nclass Solution {\npublic:\n    int maxScore(vector<int>& nums) {\n        
**Connect with me on LinkedIn https://www.linkedin.com/in/raghav-upadhyay-80336b229/**\n```\nclass Solution {\npublic:\n    int maxScore(vector<int>& nums) {\n        sort(nums.begin(),nums.end(),greater<int>());\n        long long val=0,tot=0;\n        for(auto i:nums){\n            val+=i;\n            if(val>0) tot++;\n            else break;\n        }\n        return tot;\n    }\n};\n```\n# Don\'t forgot to Upvote\u2B06\uFE0F
['C++']