Python 3 two solutions, faster than 95.91% of all Python3 submissions.
Using numpy:\n\npython\nimport numpy as np\n\nclass Solution:\n    def subtractProductAndSum(self, n: int) -> int:\n        a = [int(x) for x in str(n)]\n      
Using numpy:\n\n```python\nimport numpy as np\n\nclass Solution:\n    def subtractProductAndSum(self, n: int) -> int:\n        a = [int(x) for x in str(n)]\n        return np.prod(a) - np.sum(a)\n```\n\nUsing lambda functions:\n\n```python\nfrom functools import reduce\n\nclass Solution:\n    def subtractProductAndSum(self, n: int) -> int:\n        a = [int(x) for x in str(n)]\n        return reduce((lambda x, y: x * y), a) - reduce((lambda x, y: x + y), a)\n```\n\nLast one is faster than 95.91% of Python3 submissions and uses less than 100.00% of memory.
['Python', 'Python3']