track longest pattern in the dfa