Array:Left Rotation | HackerRank | Day 5

Опубликовано: 06 Февраль 2026
на канале: CodeCave
40
3

Array Left Rotation on HackerRank.


A left rotation operation on an array shifts each of the array's elements unit to the left. For example, [1,2,3,4,5]if left rotations are performed on array , then the array would become [2,3,4,5,1]

. Note that the lowest index item moves to the highest index in a rotation. This is called a circular array.

Given an array of n integers and a number d, perform left rotations on the array. Return the updated array to be printed as a single line of space-separated integers.