1281. Subtract the Product and Sum of Digits of an Integer Updated: 2024-03-12 1 min read Algorithms , LeetCode On This PageLeetCode problem 1281class Solution: def subtractProductAndSum(self, n: int) -> int: nums = list(map(int, str(n))) return prod(nums) - sum(nums)