Implement prototype(temps: list[int], commands: list[tuple[str, int, int]]) -> list[int | None] and solve with the same signature. Initialize internal values from temps. ('set', index, value) replaces a value; ('min', left, right) queries [left,right). Return only query results in command order, using None for empty ranges. Negative integers are valid.
Example: ([1,5], [('min',0,2), ('set',0,9), ('min',0,2), ('min',1,1)]) returns [1,5,None].
Raise ValueError for unknown operations, set indices outside 0 <= index < n, or ranges failing 0 <= left <= right <= n. Prototype: copy and scan. Final: build a segment tree with O(n) construction/space and logarithmic updates/queries. Preserve both inputs, including on failure.
Complete the starter code, then run the checks.
Results and errors will appear here.