Beats 100.00%of users with Go
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity: O(n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nfunc subtractProductAndSum(n int) int {\n    multi,sum:=1,0\n    for ; n != 0;n=n/10{\n        multi*=n%10\n        sum+=n%10\n    }\n    return multi-sum\n}\n```
['Go']