product
to 1 and sum
to 0.n
is greater than 0:
a. Extract the last digit of n
as digit
by n % 10
.
b. Update product
by multiplying it with digit
.
c. Update sum
by adding digit
to it.
d. Remove the last digit from n
by integer division n // 10
.product - sum
.