Approach hintTry it first, then revealHide
Reduce k modulo n first. A right rotation can be built from three in-place reversals of suitable ranges, which avoids an extra array.
Reduce k modulo n first. A right rotation can be built from three in-place reversals of suitable ranges, which avoids an extra array.