mirror of
https://github.com/krahets/hello-algo.git
synced 2025-08-03 04:13:40 +08:00
Improve readability of kotlin code (#1233)
* style(kotlin): Improve kotlin codes readability. * remove redundant quotes.
This commit is contained in:
@ -27,9 +27,7 @@ fun climbingStairsDPComp(n: Int): Int {
|
||||
var a = 1
|
||||
var b = 2
|
||||
for (i in 3..n) {
|
||||
val tmp = b
|
||||
b += a
|
||||
a = tmp
|
||||
b += a.also { a = b }
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
Reference in New Issue
Block a user