Rotate Array Left

Rotate array elements to the left by a specified number of positions, wrapping elements around.

Code

General
arr.rotate(n)

Parameters

Array to rotate

Positions to rotate

Server

More Ruby Snippets