📅  最后修改于: 2022-03-11 14:45:00.077000             🧑  作者: Mango
// circular rotation moving to right
func rotateRight(arr[]int, rotate int) []int {
if rotate == 0 || len(arr) == 0 || len(arr) == 1 {
return arr
}
if len(arr) < rotate {
rotate = rotate % len(arr)
}
lhs := arr[len(arr) - rotate:]
return append(lhs, arr[:len(arr) - rotate]...)
}