Sponsored
Use these hints if you're stuck. Try solving on your own first.
The parity of the indices after the removed element changes.
Calculate prefix sums for even and odd indices separately to calculate for each index in O(1).
Solve with full IDE support and test cases