Rotate
sub rotate(@a, @b) {
do for @b -> $b is copy {
$b %= @a;
[ |@a.tail(@a-$b), |@a.head: $b ]
}
}
.say for rotate <10 20 30 40 50>, <3 4>INFO
sub rotate(@a, @b) {
do for @b -> $b is copy {
$b %= @a;
[ |@a.tail(@a-$b), |@a.head: $b ]
}
}
.say for rotate <10 20 30 40 50>, <3 4>