Saved from https://leetcode-cn.com/problems/subtract-the-product-and-sum-of-digits-of-an-integer/submissions/
func subtractProductAndSum(n int) int {
sum := 0
mul := 1
for n != 0 {
r := n % 10
n /= 10
sum += r
mul *= r
}
return mul - sum
}