Product of Digits
Given a non-negative integer n, return the product of all digits in its decimal representation. The product of the single digit in 0 is 0.
Given a non-negative integer `n`, return the product of all digits in its decimal representation. The product of the single digit in `0` is `0`.
- `0 <= n <= 10^9` - The input has no leading zeroes except for the value `0` itself.
Example 1: input n = 234; output 24. The product is 2 × 3 × 4 = 24.
Example 2: input n = 105; output 0. The zero digit makes 1 × 0 × 5 equal zero.
Example 3: input n = 7; output 7. A single digit is its own digit product.
Category: Math. Topic: math. Difficulty: Easy. Patterns: math.