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 anyone tell me whats wrong with this logic ,it passes 9 test cases but fails in others by saying doesnt execute within limits
def arrayManipulation(n, q):
arr = []
for i in range(n):
arr.append(0)
for i in range(m):
a = q[i][0]
b = q[i][1]
c = q[i][2]
for j in range(a - 1, b):
arr[j] = arr[j] + c
print(max(arr))
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 anyone tell me whats wrong with this logic ,it passes 9 test cases but fails in others by saying doesnt execute within limits