Would be given a integer positive or negetive we have to reverse it keeping the sign and the reversed number should not have any trailing zeros and reversed number should not be more than a 32 but bit signed or unsigned approach.
APROACH
First we check if it is a negetive integer we remove the negetive sign and then we continue.
Then we extract each digit of the input integer and store them in a vector in reverse order and removing any trailing zeros
Then we concatenate these reversed digits into a string (num) to form the reversed number.
Then we convert num to an integer . If this results in an overflow (out of 32-bit integer range), it catches the exception and returns 0.
If the input was initially negative, it negates the reversed integer before returning it.
PROBELM - 7. Reverse Integer
APROACH
This is my approach please assign me this issue.