We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2f32bc0 commit e365a20Copy full SHA for e365a20
src/main/kotlin/g0001_0100/s0008_string_to_integer_atoi/Solution.kt
@@ -27,7 +27,7 @@ class Solution {
27
var tem = input[i] - '0'
28
tem = if (negativeSign) -tem else tem
29
// avoid invalid number like 038
30
- if (num == 0 && tem == '0'.toInt()) {
+ if (num == 0 && tem == '0'.code) {
31
i++
32
} else if (num == Int.MIN_VALUE / 10 && tem <= -8 || num < Int.MIN_VALUE / 10) {
33
return Int.MIN_VALUE
0 commit comments