Problem Description
You are given an integer N and the task is to reverse the digits of the given integer. Return 0 if the result overflows and does not fit in a 32 bit signed integer
Look at the example for clarification.
N belongs to the Integer limits.
Input an Integer.
Return a single integer denoting the reverse of the given integer.
Input 1:
x = 123
Input 2:
x = -123
Output 1:
321
Ouput 2:
-321
If the given integer is negative like -123 the output is also negative -321.
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a question? Checkout Sample Codes for more details.