Domanda di colloquio di Jane Street

graph question with regular expressions