Skip to content

Commit e365a20

Browse files
authored
Update Solution.kt
1 parent 2f32bc0 commit e365a20

File tree

1 file changed

+1
-1
lines changed
  • src/main/kotlin/g0001_0100/s0008_string_to_integer_atoi

1 file changed

+1
-1
lines changed

src/main/kotlin/g0001_0100/s0008_string_to_integer_atoi/Solution.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class Solution {
2727
var tem = input[i] - '0'
2828
tem = if (negativeSign) -tem else tem
2929
// avoid invalid number like 038
30-
if (num == 0 && tem == '0'.toInt()) {
30+
if (num == 0 && tem == '0'.code) {
3131
i++
3232
} else if (num == Int.MIN_VALUE / 10 && tem <= -8 || num < Int.MIN_VALUE / 10) {
3333
return Int.MIN_VALUE

0 commit comments

Comments
 (0)