Given an integer array nums, you can rearrange its elements in any arbitrary order.
Let prefix be an array containing the prefix sums of nums, where prefix[i] equals the sum of all elements from nums[0] through nums[i] for each index i.
The score of the rearranged array is defined as the total number of strictly positive values in the array prefix.
Return the maximum score achievable after optimally rearranging nums.
Constraints:
nums.length
nums[i]
Given an integer array nums, you can rearrange its elements in any arbitrary order.
Let prefix be an array containing the prefix sums of nums, where prefix[i] equals the sum of all elements from nums[0] through nums[i] for each index i.
The score of the rearranged array is defined as the total number of strictly positive values in the array prefix.
Return the maximum score achievable after optimally rearranging nums.
Constraints:
nums.length
nums[i]