Integer Overflow


#1

I am getting expected output as real reversed number for -1234567891
and 0 for -1146467285. How to handle this issue?


#2

It will overflow if you try to reverse the num,so sum up all the digits of org number and the number you reversed and then check if they are equal: