📌 Python3 simple solution one pass using divMod
\nclass Solution:\n    def subtractProductAndSum(self, n: int) -> int:\n        plus = 0\n        product = 1\n        n = str(n)\n        for i in n:\n        
```\nclass Solution:\n    def subtractProductAndSum(self, n: int) -> int:\n        plus = 0\n        product = 1\n        n = str(n)\n        for i in n:\n            plus = plus + int(i)\n            product = product * int(i)\n        return product - plus\n```
['Python3']