• + 0 comments

    Think of keeping an array that save the delta of operation. Then add up the array to see which index is the peak (max). By this way, you can find the optimal solution