Arrays: Left Rotation

  • + 0 comments

    def rotLeft(a, d): n=d%len(a) return (a[n:]+a[:n])

    These two lines are enough .