Solution for reverse int problem