This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from itertools import izip | |
def longest_common_substring(string_list): | |
def _iter(): | |
for row in izip(*string_list): | |
s = set(row) | |
if len(s) == 1: | |
yield s.pop() | |
else: | |
return |