bits of zeros and ones and an integer width.
Return True if every one of the 2^width binary codes of length width occurs in bits as a substring (a contiguous piece), and False otherwise.bits="0011101", width=2 → True
All four codes of width 2 appear: "00" at index 0, "01" at 1, "11" at 2 and "10" at 4.
bits="1111", width=1 → False
The code "0" never appears.
bits="0001011100", width=3 → True
bits consists only of '0' and '1'bits="0011101", width=2
True
Run checks the first 3 tests in your browser. Submit checks all 105 tests on the server, hidden ones included.