Python 3   ||   2 lines   ||   T/S: 90%  / 24%
\nclass Solution:\n    def maxScore(self, nums: List[int]) -> int:\n        \n        nums.sort(reverse=True)\n        \n        return sum(n > 0 for n in accum
```\nclass Solution:\n    def maxScore(self, nums: List[int]) -> int:\n        \n        nums.sort(reverse=True)\n        \n        return sum(n > 0 for n in accumulate(nums)) \n```\n[https://leetcode.com/problems/rearrange-array-to-maximize-prefix-score/submissions/1297203705/](https://leetcode.com/problems/rearrange-array-to-maximize-prefix-score/submissions/1297203705/)\n\nI could be wrong, but I think that time complexity is *O*(*N* log *N*) and space complexity is *O*(*N*).\n
['Python3']