class Solution:
def cycle(n, m):
if n == 0 or m == 0:
return -1
if n == 1:
return 0
return (cycle(n-1, m) + m) % n
package main
func Cycle(n, m int) int {
if n == 0 or m == 0 {
return -1
}
if n == 1 {
return 0
}
return (Cycle(n-1, m) + m) % n
}
网友评论