Search
⌘K

Leetcode 753. Cracking the Safe

Find the shortest string over digits 0..k-1 such that every possible length-n password appears as a contiguous substring (i.e., produce a de Bruijn sequence of order n on k symbols). This is typically solved by building the de Bruijn graph of k^{n-1} nodes and finding an Eulerian cycle (Hierholzer's algorithm).

Asked at:

Google

Google


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Late September, 2024

Google

Google

Junior

Implement a password cracking system

Comments

Your account is free and you can post anonymously if you choose.