Given two strings, the task is to find longest common substring, in same order, present in given strings. Remember that a substring is a sequence of characters that appears consecutively within a string.
The optimal approach is to employ dynamic programming of storing sub-problems. This entails determining the longest common suffix for all sub-strings in both sequences.