Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Speedy category for The End of Other by tamacjp
def checkio(words_set):
return any(any(w2.endswith(w1) for w2 in words_set if w2 != w1) for w1 in words_set)
#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"
Feb. 22, 2014
Comments: