Easy Java Solution
\n# Code\n\nclass Solution {\n    public int maxScore(int[] nums) {\n        Arrays.sort(nums);\n        <!-- sorting array is descending order by swapping -->\
\n# Code\n```\nclass Solution {\n    public int maxScore(int[] nums) {\n        Arrays.sort(nums);\n        <!-- sorting array is descending order by swapping -->\n        for(int i=0;i<nums.length/2;i++){\n            int ref=nums[i];\n            nums[i]=nums[nums.length-i-1];\n            nums[nums.length-i-1]=ref;\n        }\n        long sum=0;\n        int count=0;\n        for(int i=0;i<nums.length;i++){\n            sum+=nums[i];\n            if(sum>0)\n                count++;\n        }\n        return count;\n    }\n}\n```
['Sorting', 'Java']