De Bruijn sequence

ID: de-bruijn-sequence

A De Bruijn sequence is a cyclic sequence containing a particular set of symbols in such a way that every possible subsequence of a given length appears exactly once. Specifically, for a sequence of length \( n \) over an alphabet of size \( k \), a De Bruijn sequence is a cyclic sequence of length \( k^n \) in which every possible string of length \( n \) made up of the symbols from the alphabet occurs as a contiguous subsequence.

New to topics? Read the docs here!