Beginner friendly||easy to understand||c++||100%beats
Intuition\nAs it is clearly mentioned in the question  we have to arrange the given array in such a way that no of positive elements in the prefix of the array 
# Intuition\nAs it is clearly mentioned in the question  we have to arrange the given array in such a way that no of positive elements in the prefix of the array is maximum.\n\n# Approach\nSort the array(so that all elements having highest value are at the end) and maintain the sum variable and a count variable c and keep on calculation the sum till it is greater than 0,return the count.\n\n\n# Complexity\n- Time complexity:\nO(n*logn)\n\n- Space complexity:\nO(1)\n\n# Code\n```\nclass Solution {\npublic:\n    int maxScore(vector<int>& nums) {\n//Greatest element at the end\n        sort(nums.begin(),nums.end());\n int c=0;\n//To avoid integer overflow\n       long long int sum=0;\n        \nfor(int i=nums.size()-1;i>=0;i--){\nsum+=nums[i];\n    if(sum>0){\nc++;\n    }\n    else{\nbreak;\n    }\n\n}\n        return c;\n        \n       \n    }\n};\n```
['Sorting', 'C++']