Airbus Interview Question

Longest common substring. Parenthesis problem.