1281. Subtract the Product and Sum of Digits of an Integer (1) 썸네일형 리스트형 1281. Subtract the Product and Sum of Digits of an Integer Description Given an integer number n, return the difference between the product of its digits and the sum of its digits. Example Input: n = 234 Output: 15 Explanation: Product of digits = 2 * 3 * 4 = 24 Sum of digits = 2 + 3 + 4 = 9 Result = 24 - 9 = 15 Solve class Solution: def subtractProductAndSum(self, n: int) -> int: each_list = [] while n > 0: each_list.append(int(n % 10)) n //= 10 each_m.. 이전 1 다음