def is_reducible(word, word_dict):
if word in memo:
return memo[word]
res=[]
for child in children(word, word_dict):
t=is_reducible(child, word_dict)
#这里的迭代什么时候结束啊,传给t的到底是哪些值呢?
if t:
#这里是指t不是空集吗?
res.append(child)
memo[word]=res
return res
def children(word, word_dict):
res=[]
for i in range(len(word)):
child=word[:i]+word[i+1:]
if child in word_dict:
res.append(child)
return res
如果可以的话,能不能用一个单词举例子呢?