4 line easy Java solution
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\nFirst sort array and then doing prefix sum from end of array, as i have s
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\nFirst sort array and then doing prefix sum from end of array, as i have sorted array in ascending order. While taking sum also count number of prefix sum which are greater than 0.\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity: O(n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public int maxScore(int[] nums) {\n        <!-- sorting array -->\n        Arrays.sort(nums);\n        <!-- counting and taking sum from end of list-->\n        int count=0;\n        long sum=0;\n        for(int i=nums.length-1; i>=0; i--){\n            sum+=nums[i];\n            if(sum>0) count++;\n        }\n        return count;\n    }\n}\n```
['Java']