Can be done in O(N) Time and O(1) Auxiliary Space very easily


#1

Think about it .Cant post solution here thats why commented so that guys know that its possible to do without prefix sums.