We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
can the same be written like this:
def arrayManipulation(n, queries):
arr_n=[0]*n
for i in range(len(queries)):
n1=queries[i][0]
n2=queries[i][1]
for j in range(n1-1,n2):
arr_n[j]=arr_n[j]+queries[i][2]
return max(arr_n)
This is giving me a tiemout error while submitting.
can u assist here?
Cookie support is required to access HackerRank
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 →
can the same be written like this: def arrayManipulation(n, queries): arr_n=[0]*n for i in range(len(queries)): n1=queries[i][0] n2=queries[i][1] for j in range(n1-1,n2): arr_n[j]=arr_n[j]+queries[i][2] return max(arr_n) This is giving me a tiemout error while submitting. can u assist here?