Maximum Positive Prefixes

Given an array of integers, rearrange it to maximize the number of positive elements in the prefix sum array.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: