Strings Avoiding 1010 — Solution & Editorial
KMP-automaton transfer matrix (states = matched-prefix length, rejecting completion) raised to the N-th power.
Complexity: O(m3 log N)
KMP-automaton transfer matrix (states = matched-prefix length, rejecting completion) raised to the N-th power.
Complexity: O(m3 log N)