Pls help in this problem

Revision en3, by robertlewantest, 2024-04-13 20:25:48

Given an array of N positive integers. You can make any number of elements in it negative such that every prefix sum of the array remains positive i.e >0. Find the maximum number of elements you can make negative.

Example 5 2 3 5 2 3

Answer= 3. This can be converted to 5 -2 3 5 -2 -3

N is 10^5 Ai<=10^9.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English robertlewantest 2024-04-13 20:25:48 1 Tiny change: '\nAi<=10^9' -> '\nAi<=10^9.'
en2 English robertlewantest 2024-04-13 16:55:21 24 Tiny change: ' 3 5 -2 -3' -> ' 3 5 -2 -3\n\nN is 10^5\nAi<=10^9'
en1 English robertlewantest 2024-04-13 16:44:17 317 Initial revision (published)