Pergi rotasi melingkar array bergerak ke kanan

// 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]...)
}
Mackerel