solution for reverse integer