2D Array - Rotate Image

I’ve a conceptual doubt in the underlined part shown in pic . Particularly i don’t get why exactly we have taken as a[i]+n as end container . What are we supposed to take in end container .
Please give elaborate explaination