Arrays: Left Rotation

  • + 1 comment

    I agree that it timesout if the algorithm is not efficient enough. Instead of relying on rudimental loops, try using a linked list which simplifies its complexity significantly to O(dn).