https://www.reddit.com/r/csMajors/comments/18qolkl/comment/kewrgfm/?utm_source=share&utm_medium=web2x&context=3 finite state automata