Ad

Added some more test cases.

Code
Diff
  • int reverse_int_recc(int num, int rev) {
        return num ? reverse_int_recc(num / 10, rev * 10 + (num % 10)): rev;
    }
    
    int reverse_int(int num) {
        return reverse_int_recc(num, 0);
    }
    
    • int reverse_int_recc(int num, int rev) {
    • return (num == 0) ? rev : reverse_int_recc(num / 10, rev * 10 + (num % 10));
    • return num ? reverse_int_recc(num / 10, rev * 10 + (num % 10)): rev;
    • }
    • int reverse_int(int num) {
    • return reverse_int_recc(num, 0);
    • }