IBM Interview Question

1st code - based on array rotation