✅C++ || Sorting
Complexity\n- Time complexity: O(nlogn)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity: O(1)\n Add your space complexity here, e.g. O(n) \n\n
# Complexity\n- Time complexity: **O(nlogn)**\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: **O(1)**\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int maxScore(vector<int>& v) {\n        sort(v.begin(),v.end());\n        reverse(v.begin(),v.end());\n        long long a=0;\n        long long c=0;\n        for(int i=0;i<v.size();i++){\n            a+=v[i];\n            if(a>0)c++;\n        }\n        return c;\n    }\n};\n```\n![upvote (3).jpg](https://assets.leetcode.com/users/images/6dcba395-77ed-4d5e-a0a9-268614e8fdb8_1678612922.6857502.jpeg)\n
['Sorting', 'C++']