Airbus interview question

Longest common substring. Parenthesis problem.