Jump Trading Interview Question

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