code: def DFA(transitions, start, final, string):
      num = len(string)
      num_final = len(final)
      cur = start
  
      for i in range(num):
          if transitions[cur][string[i]] is None:
              return False
          else:
              cur = transitions[cur][string[i]]
  
      for i in range(num_final):
          if cur == final[i]:
              return True
      return False
  
label_desc: Use image node_id 1 for calling a global function with example usage: DFA(transitions, start, final, string) and returns: False, False, True