Python simple code
\n# Code\n\nclass Solution:\n    def subtractProductAndSum(self, n: int) -> int:\n        s = 0\n        mult = 1\n\n        while n > 0:\n            digit = n
\n# Code\n```\nclass Solution:\n    def subtractProductAndSum(self, n: int) -> int:\n        s = 0\n        mult = 1\n\n        while n > 0:\n            digit = n%10\n            s += digit\n            mult *= digit\n            n = n//10\n\n        return mult-s\n\n        \n```
['Math', 'Python', 'Python3']