Arrays: Left Rotation

  • + 0 comments

    No it isn't. (i + n) % a.length and (i + n%a.length) % a.length are the same thing. It's only useful for the case where n is close to int maximum so that i + n overflows.