Tech Mahindra interview question

Extract elements from circular array