There is an array,a[ ] of n elements and is rotated in circular right direction for k times.
m in any index of an element in that array i.e. 0 <= m <= n .
then to get that mth element
FORMULA is
a[m] = a[ (( m - k ) % n + n ) % n ]
What is the logic behind that formula?