#47 - Rotate Array by one position
You are given an array of integers and a direction (left
or right
). Your task is to implement a function to rotate the array by one position in the specified direction.
Example 1
Input
Output
Example 2
Input
Output
Last updated