You are viewing a single comment's thread. Return to all comments →
Thanks, It made me to think with a different POV to solve in Python
def arrayManipulation(n, queries):
res = [0]*(n+1) for q in queries: res[q[0]-1] += q[2] res[q[1]] -= q[2] s = 0 m = 0 for l in res: s += l m = max(m,s) return m
Seems like cookies are disabled on this browser, please enable them to open this website
I agree to HackerRank's Terms of Service and Privacy Policy.
Array Manipulation
You are viewing a single comment's thread. Return to all comments →
Thanks, It made me to think with a different POV to solve in Python
def arrayManipulation(n, queries):