OpenText Interview Question

started with left and right rotation of the array and asking continuous modifications in the code