Tech Mahindra Interview Question

Extract elements from circular array