Python, 8ms faster than 97.7%
\ndef subtractProductAndSum(self, n):\n        dm = {\'0\': 0, \'1\': 1, \'2\': 2, \'3\': 3, \'4\': 4, \'5\': 5, \'6\': 6, \'7\': 7, \'8\': 8, \'9\': 9}\n      
```\ndef subtractProductAndSum(self, n):\n        dm = {\'0\': 0, \'1\': 1, \'2\': 2, \'3\': 3, \'4\': 4, \'5\': 5, \'6\': 6, \'7\': 7, \'8\': 8, \'9\': 9}\n        s = repr(n)\n        sm, pr = 0, 1\n        for c in s:\n            pr *= dm[c]\n            sm += dm[c]\n        return pr-sm\n```
[]