DP: longest common substring