Problem Statement
To find the "reverse sum" of a number, we reverse the digits of the number and then add the original number to the reversed number. For example, to find the reverse sum of 1325, first reverse the digits to get 5231. Then, add the original number to get 5231+1325=6556.
Return the reverse sum of the given number N.
Definition
- Class:
- ReverseSums
- Method:
- getSum
- Parameters:
- int
- Returns:
- int
- Method signature:
- int getSum(int N)
- (be sure your method is public)
Constraints
- N will be between 1 and 99999, inclusive.
Examples
1325
Returns: 6556
The example from the problem statement. 1325 + 5231 = 6556.100
Returns: 101
100 + 001 = 10189437
Returns: 162935
89437 + 73498 = 1629351
Returns: 2