Skip to content

Commit 83444b9

Browse files
优化一下代码
1 parent d81f5d8 commit 83444b9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/Leetcode_Solutions/007._Reverse_Integer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,6 @@ class Solution:
102102
"""
103103
mark = 1 if x>=0 else -1
104104
x_abs = abs(x)
105-
result = mark * int(''.join(str(x_abs)[::-1]))
105+
result = mark * int(str(x_abs)[::-1])
106106
return result if -2**31 <= result <= 2**31-1 else 0
107107
```

0 commit comments

Comments
 (0)