Array Rotation

Easy
Arrays Array

Rotate array to the right by k steps. Print result space-separated.

Constraints

1 ≤ nums.length ≤ 10^5

Examples

Example 1:
Input: 1 2 3 4 5 6 7 3
Output: 5 6 7 1 2 3 4
Example 2:
Input: -1 -100 3 99 2
Output: 3 99 -1 -100
▲ Console

Install Talent Arabia

Get instant access to jobs and career tools on your device.