Longest Common Prefix — Solution & Editorial
Start with the first word as the candidate and shrink it against each next word.
Complexity: O(total input size)
Start with the first word as the candidate and shrink it against each next word.
Complexity: O(total input size)