Hi, I run the code on ide and find it could handle negative. In this case, why you write a getSubtract method here? I think we can use getSum() handing the negative number to represent subtract. Correct me if my thought is wrong. Thx
I am not familiar with python...
But I think this is caused by python's int is not 32 bit length.
in c++, a or b will just left shift to sth. like 1000 0000 0000 0000 0000 0000 0000 0000 and then go to zero.
I guess in python we dont have the time waiting it turns to zero.
I think you can fix it by just adding
at the begining.
You can say that this is a kind of bug of my code...>_<
Again, I am not familiar with python, nice try for writing it into python.
Hope you can get it right, and give me a thumbs-up~~ : )