Kotlin Greedy
\n  class Solution {\n    fun maxScore(nums: IntArray): Int {\n      nums.sortDescending()\n\n      var sum = 0L\n      var res = 0\n      for (v in nums) {\n  
```\n  class Solution {\n    fun maxScore(nums: IntArray): Int {\n      nums.sortDescending()\n\n      var sum = 0L\n      var res = 0\n      for (v in nums) {\n        sum += v\n        \n        if (sum > 0L)\n          res++\n      }\n      return res\n    }\n  }\n\n```
['Kotlin']