how to solve circular array rotation