I need help writing an algorithm that will check the validity of a string in a given pattern which is in the form of FSM and I have no clue how to do it.