There is a safe protected by a password consisting of a sequence of n digits, where each digit is chosen from the first k digits from
The safe keypad tracks the most recently entered digits. Entering a new digit causes the safe to check the last n entered digits. If this sequence matches the password, the safe unlocks.
Return any string of the minimum possible length that is guaranteed to unlock the safe at some point during the sequence of typed digits.
Constraints:
n
k
k
There is a safe protected by a password consisting of a sequence of n digits, where each digit is chosen from the first k digits from
The safe keypad tracks the most recently entered digits. Entering a new digit causes the safe to check the last n entered digits. If this sequence matches the password, the safe unlocks.
Return any string of the minimum possible length that is guaranteed to unlock the safe at some point during the sequence of typed digits.
Constraints:
n
k
k