Amazon Interview Question

They asked me to write a code to rotate an array to right by k steps