Arrays: Left Rotation

  • + 24 comments

    Python 3

    It is way easier if you choose python since you can play with indices.

    def array_left_rotation(a, n, k):
        alist = list(a)
        b = alist[k:]+alist[:k]
        return b