Support update(index, val) and sumRange(left, right) efficiently.
Once you solve it, you'll recognize when input structure allows efficient traversal in similar problems. Focus on understanding why this approach works. Once you grasp the pattern, similar problems become straightforward to solve.
Example: Array [1,3,5], sumRange(,) = , update(,), sumRange(,) = .
Constraints: nums.length . Up to calls.