• + 0 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

    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))