Perl 5, 41 bytes
39 bytes plus two for the
-lF flags (
-M5.01 is free):
perl -lF -M5.01 script.pl
-lFreads the input, removes the trailing newline, puts the remainder into the string
$_, splits it up into characters, and puts that split into the array
$`equal to the stuff before it and
$'equal to the stuff after it.
$'.$`is thus the number of times to rotate the array.
- Now for every element of the list from
$'.$`, rotate the array (
popthe last element and
unshiftit onto the beginning).
sayall the elements of the rotated array.