• + 23 comments

    Relevant Wikipedia article: https://en.wikipedia.org/wiki/Longest_common_subsequence_problem

    A straightforward solution uses O(n^2) time and space. Optimizations can reduce both of these.