Given two integer N and K. The task is to find the string S of minimum length such that it contains all possible strings of size N as a substring. The characters of the string can be from 0 to K-1.
- Time : O(k^n)
- Space : O(k^n)
c++
1 | class Solution { |