Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for The End of Other by quis20
def checkio(words_set):
for i,word in enumerate(words_set, start=1):
for j,second_word in enumerate(words_set, start=1):
if i != j:
pos = word.find(second_word, len(word)-len(second_word))
if pos != -1:
return True
return False
#These "asserts" using only for self-checking and not necessary for auto-testing
if __name__ == '__main__':
assert checkio({"hello", "lo", "he"}) == True, "helLO"
assert checkio({"hello", "la", "hellow", "cow"}) == False, "hellow la cow"
assert checkio({"walk", "duckwalk"}) == True, "duck to walk"
assert checkio({"one"}) == False, "Only One"
assert checkio({"helicopter", "li", "he"}) == False, "Only end"
Jan. 24, 2016