Implement prototype(values: list[int], commands: list[tuple[str, int, int]]) -> list[int] and solve with the same signature. Work on internal state initialized from values. ('add', index, delta) adds an integer; ('sum', left, right) queries [left,right). Return only sum results in command order. Empty ranges sum to 0; negative values/deltas are valid.
Example: ([2,4,6], [('sum',0,3), ('add',0,-5), ('sum',0,2)]) returns [12,1].
Raise ValueError for unknown operations, add indices outside 0 <= index < n, or ranges failing 0 <= left <= right <= n. Prototype: copy and scan. Final: use a Fenwick tree with logarithmic operations. Preserve both inputs, including on failure.
Complete the starter code, then run the checks.
Results and errors will appear here.