You are viewing a single comment's thread. Return to all comments →
can the same be written like this:
def arrayManipulation(n, queries):
for i in range(len(queries)):
for j in range(n1-1,n2):
This is giving me a tiemout error while submitting.
can u assist here?
yeah,at the beginning, l got the same problem as well. This algorithm's complexity could be o(n). Try to learn something about prefix sum array.I hope this can help.