Constant Subsequence
Alice has an array $A$ of length $N$, and her goal is to rearrange the array in a way that minimises the maximum subarray sum of the resulting array. However, Alice must keep the relative order of all non-negative and negative elements the same as in the original array. In other words: - The non-negative numbers should appear in the same order as they originally appeared in $A$. - The negative nu
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start