Capgemini Engineering Interview Question

program for pattern detector for FSM