Nearest Beautiful Number (hard version) solution codeforces

Nearest Beautiful Number (hard version) solution codeforces For Solution Click Here! It is a complicated version of problem F1. The difference between them is the constraints (F1: k≤2k≤2, F2: k≤10k≤10). You are given an integer nn. Find the minimum integer xx such that x≥nx≥n and the number xx is kk–beautiful. A number is called kk–beautiful if its decimal representation having no leading zeroes contains no more than kk different …

Nearest Beautiful Number (hard version) solution codeforces Read More »