💯✅JAVA | SUPER EASY SOLUTION
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\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```\nimport java.util.*;\n\nclass Solution {\n    public int maxScore(int[] nums) {\n        desc(nums);\n        int n=nums.length;\n        long[]pre=new long[n];\n        int maxScore=0;\n        pre[0]=nums[0];\n        if(pre[0]>0) maxScore++;\n        for(int i=1;i<n;i++){\n            pre[i]=pre[i-1]+nums[i];\n            if(pre[i]>0){\n                maxScore++;\n            }\n        }\n        return maxScore;\n    }\n    \n    public void desc(int[]nums){\n        Arrays.sort(nums);\n        int n=nums.length;\n        for(int i=0;i<n/2;i++){\n            int temp=nums[i];\n            nums[i]=nums[n-i-1];\n            nums[n-1-i]=temp;\n        }\n    }\n}\n```
['Java']