How to solve this question ? (Asked in Amazon sde-1 OA)

Input = n
You have to form string of minimum length.
string will form n distinct substring.
string should be smallest in lexographical order

ex n = 3
ans - ab
substring - a , b , ab

Comments (0)