leetle

Daily challenge for 2026-05-04

489. Digital Product Root

Given a non-negative integer n, calculate the product of its digits. If the resulting product is greater than or equal to 10, repeat the process until the product is a single-digit number. Return this final single-digit product.

Example:
Input: n = 34
Output: 2
Explanation: 3 * 4 = 12. Since 12 >= 10, we repeat: 1 * 2 = 2.

Run this challenge interactively in Python or JavaScript when the app loads.