peopleHum interview question

Rotating array coding question to solve