The TransCompilator

Solved LeetCode program · 920 of 1,000

#1281 · Subtract the Product and Sum of Digits of an Integer

Easy Math chunk-19.md

Original English source

The source is 234. The value is source. The product is 1. The sum is 0.
Repeat while value is more than 0.
The digit is value modulo 10. Set product to product times digit. Add digit to sum. Set value to value divided by 10.

The answer is product minus sum. Show answer.

Open in Playground Browse all 1,000 problems

Expected stdout

15