Java Solution
\n\n# Code\njava []\nclass Solution {\n    public int maxScore(int[] nums) {\n        Arrays.sort(nums);\n        long sum = 0;\n        for(int i=nums.length-1
\n\n# Code\n```java []\nclass Solution {\n    public int maxScore(int[] nums) {\n        Arrays.sort(nums);\n        long sum = 0;\n        for(int i=nums.length-1;i>=0;i--){\n            sum+=nums[i];\n            if(sum<=0)\n            return nums.length-i-1;\n        }\n        return nums.length;\n    }\n}\n```
['Java']