Concept Flow - Longest Common Prefix
Start with first string as prefix
Compare prefix with next string
Find common prefix between prefix and current string
Update prefix to this common prefix
More strings?
Yes→Repeat comparison
No
Return prefix
Start with the first string as the prefix. Compare it with each string to find the common prefix. Update the prefix each time. Stop when no more strings or prefix is empty.
