Deqode interview question

Rotate a given array by n index.