Concept Flow - Longest Common Substring
Start with two strings
Create 2D table of size (len1+1) x (len2+1)
Initialize all cells to 0
For each character pair (i,j)
If chars match: table[i
Update max length and position if needed
After filling table, extract substring from max position
Return longest common substring
Done
We build a table to track matching characters between two strings, updating lengths of common substrings and remembering the longest found.