Re: Why this answer is wrong?

Did I meet a bug of leetcode system?please help me!

class Solution(object):

def reverse(self, x):

"""

:type x: int

:rtype: int

"""

f = 0

```
if x<0:
x=-x
f = 1
if f==0 and x>1000000003:
return 0
if f==1 and x>1000000003:
return -x
l = len(str(x))
x = str(x)
y =''
for i in xrange(l):
y = x[i] + y
y = int(y)
if f==1:
y = -y
return y
```

But the system said:

Input: -2147483412

Output: -2147483412

Expected: -2143847412

It's amazing !!Why???

```
if f==1:
y = -y
return y
```