can anyone post the solution of HackerRank Array Manipulation?
https://www.hackerrank.com/challenges/crush/problem
I did my best with:
def listMax(n, operations):
# Write your code here
l = [0 for i in range(n)]
def doOperation(a,b,k):
for i in range(a-1,b):
val = l[i]
val += k
l[i] = val
for op in operations:
a,b,k = op[0],op[1],op[2]
doOperation(a,b,k)
l.sort()
return l [n-1]
...but I was not able to pass the performance tests getting
time out