1234
// x is the array position to overlap (in your example, 1) x = 1; for(int i = x; i < a.size( ) < i++) a[i] = a[i + 1];