You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

18 lines
259 B

package solutions
func Game23(a, b int) int {
if a > b {
return -1
}
if a == b {
// fmt.Printf("%d\n", cnt)
return 0
}
if Game23(a*2, b) != -1 {
return 1 + Game23(a*2, b)
}
if Game23(a*3, b) != -1 {
return 1 + Game23(a*3, b)
}
return -1
}