#48 - Rotate Array by K times
You are given an array of integers and an integer k
. Your task is to implement a function to rotate the array to the left or right by k
positions.
Example 1
Input
Output
Example 2
Input
Output
Last updated