1281. Subtract the Product and Sum of Digits of an Integer 💻 💻|| 100% easy🔥🔥 || JAVA code...
Code\n\nclass Solution {\n    public int subtractProductAndSum(int n) {\n        int r =0;\n        int res = n;\n        int sum = 0;\n        int prod = 1;\n\
# Code\n```\nclass Solution {\n    public int subtractProductAndSum(int n) {\n        int r =0;\n        int res = n;\n        int sum = 0;\n        int prod = 1;\n\n        while(res>0){\n            r = res%10;\n            res = res/10;\n            sum+=r;\n            prod*=r;\n\n        }\n        return (prod-sum);\n    }\n}\n```
['Java']