Pregunta de entrevista de Uber

Given a regular expression pattern and a string, check to see if pattern matches the string.

Respuestas de entrevistas

Anónimo

8 dic 2015

#1: generate a non-finite automaton (NFA) from the regular expression. #2: convert NFA to Deterministic finite automaton (DFA) #3: run string through DFA to see if there is a match

Anónimo

5 ago 2014

Similar to checking if 2 strings are similar (maintain pointers in each string and forward if matches) but look for special chars (like *, & etc)