Multiplication on Array : Range update query in O(1)
Consider an array A[] of integers and the following two types of queries. update(l, r, x): multiply x to all values from A[l] to A[r] (both inclusive).printArray(): Prints the current modified array. Examples: Input: A[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1} update(0, 2, 2) update(1, 4, 3) print() update(4, 8, 5) print() Output: 2 6 6 3 15 5 5 5 5 1 Exp