← ALL NOTES
Math

7. Reverse Integer

Reversing the digits is a two-line loop: peel the last digit with x % 10, push it onto the result with result 10 + digit. The entire problem is the overflow guard — and the catch is you can't compute…

Loading…