Problem 3701 · Easy

Compute Alternating Sum

Add the values at even indices and subtract the values at odd indices in one pass.

Open the interactive visualisation