• + 1 comment

    Don't use a string to manipulate the data. Use the % and / operators to reverse the input.

    Also you don't need to use the absolute value function when checking the difference's equality to 0 since 0 does not have a sign.

    edit: