Product Minus Sum of Digits
Multiply all the digits of n together, add all the digits of n together, and return the product minus the sum.
Example 1
n 234
returns 15
Product 24, sum 9, so 15.
Example 2
n 4421
returns 21
Product 32, sum 11, so 21.
Constraints
1 <= n <= 10**6
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More Math problems
- Seconds to ClockBeginner
- Staircase of StonesBeginner
- Steps to Reduce to ZeroBeginner
- Sum of Consecutive PowersBeginner
- Sum of DivisorsBeginner
- Sum of MultiplesBeginner
- Type of TriangleBeginner
- Add Minutes to a ClockEasy