Solve the question using long long int
and check it later, they’re within the range or not.
HINT for the question
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.