Largest number from given digits and max continuous frequency k.

Revision en1, by Aspergillus, 2025-02-13 16:02:16

I was asked this problem in an OA. I am given an n digit number (n <= 1e7), and a number k (<= n)

I was asked to build the largest possible number using some of these digits (maybe all), such that the largest continuous same digit length is <= k.

Thought a lot but could'nt solve. Now I am curious because the solution isnt available online.

pls help i beg.

Tags digits

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Aspergillus 2025-02-13 16:02:16 434 Initial revision (published)