Left Rotate Array (In Place)

JavaScript Medium 5 views
Back to Questions

Problem Description

Given an array and a number k, rotate the array to the left by k steps and print the result.

Input Format

Line1: n then n integers. Line2: k.

Output Format

One line: rotated array.

Sample Test Case

Input:
6 10 20 30 40 50 60 2
Output:
30 40 50 60 10 20

Constraints

1

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next