mirror of https://github.com/01-edu/public.git
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.
19 lines
259 B
19 lines
259 B
5 years ago
|
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
|
||
|
}
|