mirror of
https://github.com/krahets/hello-algo.git
synced 2026-08-12 03:40:58 +00:00
build
This commit is contained in:
@@ -357,14 +357,14 @@ $$
|
||||
val b = n % 3
|
||||
if (b == 1) {
|
||||
// 当余数为 1 时,将一对 1 * 3 转化为 2 * 2
|
||||
return 3.0.pow((a - 1).toDouble()).toInt() * 2 * 2
|
||||
return 3.0.pow((a - 1)).toInt() * 2 * 2
|
||||
}
|
||||
if (b == 2) {
|
||||
// 当余数为 2 时,不做处理
|
||||
return 3.0.pow(a.toDouble()).toInt() * 2 * 2
|
||||
return 3.0.pow(a).toInt() * 2 * 2
|
||||
}
|
||||
// 当余数为 0 时,不做处理
|
||||
return 3.0.pow(a.toDouble()).toInt()
|
||||
return 3.0.pow(a).toInt()
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user