Given an integer array nums, implement:
update(index, val): Updatenums[index]tovalsumRange(left, right): Return the sum of elements fromlefttorightinclusive Example:
nums = [1, 3, 5]
sumRange(0, 2) → 9
update(1, 2)
sumRange(0, 2) → 8
``` You're solving the textbook segment tree application.
Both operations must be efficient. Constraints: up to $3 \cdot 10^4$ elements, up to $3 \cdot 10^4$ operations.