Add longest common substring with DP