There is a box protected by a password. The password is n digits, where each letter can be one of the first k digits 0, 1, ..., k-1. You can keep inputting the password, the password will automatically be matched against the last n digits entered. Fo…