Pergunta de entrevista da empresa Jump Trading

Given 2 string and a parent string find index matches of both in parent Comment very complex python code