HINT for the question


Solve the question using long long int and check it later, they’re within the range or not.


Check for the cases when A = -1,111,123,345.
Here when you try to reverse the value must be -5,433,211,111 , which will result in integer overflow. So while reversing for such cases, check at intermediate steps if there is no overflow.


You can also compare new number with -214748365 or 214748365 at each step