Python Non-deterministic Finite Automaton (NFA)
\nimport collections\n\nclass Solution:\n    def isMatch(self, s: str, p: str) -> bool:\n        if not p: return False if s else True\n        \n        delta 
```\nimport collections\n\nclass Solution:\n    def isMatch(self, s: str, p: str) -> bool:\n        if not p: return False if s else True\n        \n        delta = collections.defaultdict(int)\n        delta[(0, \'*\')] = 0\n        state = 1\n        for c in p:\n            if c == \'*\':\n                delta[(state, \'*\')] = state\n                continue\n                \n            delta[(state, c)] = state + 1\n            state += 1\n        \n        accept_state = state\n        cur_states = set([1])\n        i = 0\n        while i < len(s):\n            next_states = set()\n            cur_char = s[i]\n            for cur_state in cur_states:\n                if (cur_state, \'*\') in delta:\n                    next_states.add(delta[(cur_state, \'*\')])\n                    \n                if (cur_state, \'?\') in delta:\n                    next_states.add(delta[(cur_state, \'?\')])\n                else:\n                    next_states.add(delta[(cur_state, cur_char)])\n            \n            cur_states = next_states\n            i += 1\n        \n        return accept_state in cur_states and i == len(s) \n```\n\nIf you have taken a class on finite automata then this solution should be really simple to understand, otherwise it might feel cryptic. Hopfully this provides a different perspective than other solutions.
['Python']