package com.fishercoder.solutions;

/**
 * 7. Reverse Integer
 *
 * Reverse digits of an integer.

 Example1: x = 123, return 321

 Example2: x = -123, return -321

 */
public class _7 {

    public static class Solution1 {
        public int reverse(int x) {
            long rev = 0;
            while (x != 0) {
                rev = rev * 10 + x % 10;
                x /= 10;
                if (rev > Integer.MAX_VALUE || rev < Integer.MIN_VALUE) {
                    return 0;
                }
            }
            return (int) rev;
        }
    }
}
@@ -59,15 +59,42 @@
 ger%0A
- *%0A * R
+%0A Given a 32-bit signed integer, r
 ever
@@ -131,26 +131,32 @@
 mple
+ 
 1:
- x = 123, return
+%0A Input: 123%0A Output:
  321
@@ -169,33 +169,323 @@
 mple
+ 
 2:
- x = -123, return -321%0A
+%0A Input: -123%0A Output: -321%0A%0A Example 3:%0A Input: 120%0A Output: 21%0A%0A Note:%0A Assume we are dealing with an environment which could only store integers within the 32-bit signed integer range: %5B%E2%88%92231,  231 %E2%88%92 1%5D.%0A For the purpose of this problem, assume that your function returns 0 when the reversed integer overflows.
 %0A */
@@ -595,17 +595,20 @@
  long re
-v
+sult
  = 0;%0A  
@@ -656,15 +656,21 @@
   re
-v
+sult
  = re
-v
+sult
  * 1
@@ -728,17 +728,20 @@
   if (re
-v
+sult
  %3E Integ
@@ -758,17 +758,20 @@
 UE %7C%7C re
-v
+sult
  %3C Integ
@@ -875,17 +875,20 @@
 (int) re
-v
+sult
 ;%0A      

refactor 7