Python 3 faster than 98.48%
The prod method method from the math standard library was added in Python 3.8 onwards.\n\n\nfrom math import prod\n\nclass Solution:\n    def subtractProductAnd
The `prod` method method from the math standard library was added in Python 3.8 onwards.\n\n```\nfrom math import prod\n\nclass Solution:\n    def subtractProductAndSum(self, n: int) -> int:\n        nums = [int(x) for x in str(n)]\n        return prod(nums)-sum(nums)\n```\n\nhttps://docs.python.org/3.8/library/math.html#math.prod
['Python']