Given an integer array nums, implement: - update(index, val): Update nums[index] to val - sumRange(left, right): Return the sum of elements from left to right inclusive 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 elements, up to operations.