• + 2 comments
    n, m = input().strip().split(' ')
    n, m = [int(n), int(m)]
    l = [0] * (n+1)
    for a0 in range(m):
        a, b, k = input().strip().split(' ')
        a, b, k = [int(a), int(b), int(k)]
        l[a:b+1] = list(map(lambda x:x+k,l[a:b+1]))
    print(max(l))
    

    The above code is showing runtime error for test case 7 onwards. please suggest the reason?