• + 0 comments

    My js solution ran out of time for a few test cases

    function arrayManipulation(n, queries) { let a = new Array(n).fill(0); for(let j = 0; j < queries.length; j++) { let temp = queries[j] let k = temp[0]; while(k <= temp[1]) { a[k-1] += temp[2]; k++; }

    } return Math.max.apply(Math, a); }