Pergunta de entrevista da empresa MongoDB

Longest Common Subsequence optimised solution.