Solution of subtract the product and sum of digits of an integer problem
Approach\n- Solved using simple loop\n- We iterate over a number and multiply and sum the digits of the number\n\n# Complexity\n- Time complexity:\n0(n) - as we
# Approach\n- Solved using simple loop\n- We iterate over a number and multiply and sum the digits of the number\n\n# Complexity\n- Time complexity:\n$$0(n)$$ - as we are iterating over n elements.\n\n# Code\n```\nclass Solution:\n    def subtractProductAndSum(self, n: int) -> int:\n        product_d, sum_d = 1, 0\n        for digit in str(n):\n            product_d *= int(digit)\n            sum_d += int(digit)\n        return product_d - sum_d\n\n```
['Python3']