• + 1 comment

    Brilliant man, mine was working for initial test cases but getting timeout for rest.

    def arrayManipulation(n, queries):
        a = [0]*(n +1)
        z=[]
        for i in queries:
            z.append(i)
        for i in range(len(z)):
            for j in range(int(z[i][0]),int( z[i][1])+1):
                a[j] = a[j]+int ( z[i][2])
        return max(a)