Using StringBuffer solve Reverse Integer problem

LeetCode: https://leetcode.com/problems/reverse-integer/description/

The below Solution 1 is the most popular solution we can find online.
But here is another way (Solution 2) to solve the problem with StringBuffer.

The Solution 2 is easier to understand and the code is cleaner.

Continue reading “Using StringBuffer solve Reverse Integer problem”