This commit is contained in:
Kagura 2024-11-14 17:53:01 +08:00
parent 57188457a6
commit 6ecbb3232a

13
src/Test344.kt Normal file
View file

@ -0,0 +1,13 @@
class Test344 {
class Solution {
fun reverseString(s: CharArray): Unit {
var l = 0
var r = s.lastIndex
while (l < r){
s[l] = s[r].also { s[r] = s[l] }
l++
r--
}
}
}
}