def checkio(words_set):
print words_set # result -> set([u'lo', u'hello', u'he'])
st=list(set(words_set))
l=len(st)
x=0
print st
for i in range(l-1):
if st[i].endswith(st[i+1])==1:
print st[i], st[i+1]
x+=1
if x>0:
return 1
else:
return 0
if __name__ == '__main__':
assert checkio({u"hello", u"lo", u"he"}) == True, "helLO"
My english isn't good, but how i can find suffixes if this [u"hello", u"lo", u"he"] != [u'lo', u'hello', u'he']
Created at: 2015/05/31 22:54; Updated at: 2015/05/31 23:43