• + 1 comment

    how does it makes a difference if i first calculated array after all operations by adding to it its previous value and then finding the maximum value of that array in seperate loop, and by simply adding the value and checking it for maximum value ??

    i think both will take o(n).