You are viewing a single comment's thread. Return to all comments →
#### I Hope it Helps
def arrayManipulation(n, queries): a = [0]*n maxx = 0 x = 0 for init, final, k in queries: if(k == 0): continue a[init-1] += k if(final < n): a[final] -= k for element in a: x += element if(maxx < x): maxx = x return maxx
Seems like cookies are disabled on this browser, please enable them to open this website
Array Manipulation
You are viewing a single comment's thread. Return to all comments →
Python Code
#### I Hope it Helps