Simple java recursive approach
A recursive approach. Beats 100%\n\n\tclass Solution {\n    public int subtractProductAndSum(int n) {\n        return prodDigits(n) - sumDigits(n);\n    }\n    
A recursive approach. Beats 100%\n\n\tclass Solution {\n    public int subtractProductAndSum(int n) {\n        return prodDigits(n) - sumDigits(n);\n    }\n    \n    public int sumDigits(int N){\n        if(N < 10)return N;\n        return sumDigits(N/10)+(N%10);\n    }\n    \n    public int prodDigits(int N){\n        if(N < 10)return N;\n        return prodDigits(N/10)*(N%10);\n    }\n}
['Recursion', 'Java']