22. Supermarket Digit Product Price
Difficulty: easy · Math
Problem
A supermarket prints a code `N` on every product. When the scanner reads `N`, the price of the item is the **product of all the digits** of `N`. Given `N`, print the price.
Input
A single line containing the positive integer `N` (no leading zeros).
Output
Print the product of the digits of `N`.
Example 1
Input: 5244 Output: 160
Explanation: 5 * 2 * 4 * 4 = 160.
Example 2
Input: 1023 Output: 0
Explanation: The digit 0 makes the product 0.
Constraints
- 1 <= N <= 10^18
Solutions are judged against 2 sample and 10 hidden tests. Sign in to solve it · All problems