Arrays: Left Rotation

  • + 0 comments

    Better to use linked list, so no need to LOOP fully:

    val z = LinkedList(a.toList()) for(i in 0 until n) z.addLast(z.pollFirst())