Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Trie with O(n) complexity solution in Speedy category for The End of Other by nptwz
from collections import defaultdict
def checkio(words_set):
def r():
return defaultdict(r)
def ins(trie,s):
pt = trie
for c in s:
pt = pt[c]
pt['*'] = 1
def exist(trie,s):
pt = trie
for i,c in enumerate(s):
if c in pt:
pt = pt[c]
if '*' in pt and i
Aug. 15, 2014