How to solve longest common subSTRING with DP?

Longest common substring, thx!

//