Range update point query
Your task
Maintain an array of n integers, all initially 0, supporting two operations given in ops (0-indexed): ["u", l, r, delta] adds delta to every element in the inclusive range [l, r], and ["q", i] returns the current value at index i. Return the answers to the query operations in order. Both operations must run in O(log n). 1 <= n <= 100000, len(ops) <= 100000.
Examples
fenwick_range_update(n: int, ops: list[list]) -> list[int]Example 1
Input
fenwick_range_update(5, [["u", 1, 3, 2], ["q", 2], ["q", 4]])Output
[2, 0]