Destroying Array

CodeForces - 722C