Example: ABCBDAB and BDCABA share BCBA. It is solved with a two-dimensional table in O(n*m).