Rotate Array

Given an integer array of length \(N\), rotate the array to the right by \(k\) steps, where \(k \ge 0\). Rotation is periodical, e.g., rotating a 5-item array 13 times yields the same result as rotating it \( 13 \mod 5 = 3\) times. So our effective \(k\) is \(k \mod N\). That \(k \ge 0\) saves us from worrying about how the programming language implements modulo operations .