Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
Change-Id: I8621859a4033882c214452f15349f3f15d160f50
  • Loading branch information
JINGUIWANG committed Dec 15, 2014
1 parent 75245c2 commit 20424da
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ReverseInteger.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*
Author: Annie Kim, anniekim.pku@gmail.com
Date: Apr 7, 2013
Update: Sep 1, 2013
Update: Dec 14, 2014 (By wangjingui@outlook.com)
Problem: Reverse Integer
Difficulty: Easy
Source: http://leetcode.com/onlinejudge#question_7
Source: https://oj.leetcode.com/problems/reverse-integer/
Notes:
Reverse digits of an integer.
Example1: x = 123, return 321
Expand All @@ -26,7 +26,7 @@ class Solution {
res = res * 10 + (x % 10);
x /= 10;
}
assert(res >= INT_MIN && res <= INT_MAX);
if (res < INT_MIN || res > INT_MAX) return 0;
return res;
}
};
};

0 comments on commit 20424da

Please sign in to comment.