Arrays: Left Rotation

  • + 0 comments

    Python efficient using mod:

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