Math Online Assessment Question

Правка en2, от Summer_Wind, 2024-08-05 20:30:07

Problem : Given a number k, find a k-digit string where the product of its digits is greater than or equal to the sum of its digits. If there are multiple such strings, return the one with the minimum product. If there are still ties, return the lexicographically smallest string.

Testcases:

Input : 1 Output : 1

Input : 2 Output : 22

Input : 3 Output : 123

Input : 4 Output : 1124

Input : 5 Output : 11222

Input : 6 Output : 111126

Constraints:

1 <= K <= 100000

How to solve this? Please help!

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский Summer_Wind 2024-08-05 20:30:07 4 Tiny change: 'tput : 111223\n\n**Cons' -> 'tput : 111126\n\n**Cons'
en1 Английский Summer_Wind 2024-08-04 21:23:19 581 Initial revision (published)