You are viewing a single comment's thread. Return to all comments →
amazing!!
Python implimentation of this logic:
def optimised(n, queries): intial = [] _max = 0 x = 0 for _ in range(1, n+1): intial.append(0) for query in queries: intial[query[0]] += query[2] if query[1]+1 <= len(intial) - 1: intial[query[1]+1] -= query[2] for i in intial: x += i _max = max(x, _max) return _max
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 →
amazing!!
Python implimentation of this logic: