Advertisement
Guest User

Untitled

a guest
Dec 9th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.27 KB | None | 0 0
  1. class Solution(object):
  2.     def subtractProductAndSum(self, n):
  3.         """
  4.        :type n: int
  5.        :rtype: int
  6.        """
  7.         count = 1
  8.         for i in str(n):
  9.             count = count * int(i)
  10.  
  11.         return(count - sum(map(int,str(n))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement