Tap here to switch tabs
Problem
Submissions

Problem: Smallest Number With Given Digit Product

Try to solve the Smallest Number With Given Digit Product problem.

Statement

Given a positive integer n, return the smallest positive integer as a string such that the product of its digits is equal to n. If no such integer exists, return "-1".

Constraints:

  • 1≤1 \leq n ≤1018\leq 10^{18}

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Smallest Number With Given Digit Product

Try to solve the Smallest Number With Given Digit Product problem.

Statement

Given a positive integer n, return the smallest positive integer as a string such that the product of its digits is equal to n. If no such integer exists, return "-1".

Constraints:

  • 1≤1 \leq n ≤1018\leq 10^{18}