Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Solution {
- public int reverse(int x) {
- int res = 0;
- while (x != 0)
- {
- if (res > 214748364 || res < -214748364)
- return 0;
- res = res * 10 + x % 10;
- x /= 10;
- }
- return res;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement