Lucid Imaging interview question

Circular prime number Array rotation with conditions