def solution(begin, target, words): if not target in words: return 0 answer = 0 queue = [begin] while words!=[]: answer+=1 tmp=[] while queue: word_stack=queue.pop(0) for word in words: change=0 for i in range(len(word)): if word[i]==word_stack[i]: change+=1 if change==len(word)-1: tmp.append(word) words= list([word for word in words if word not in tmp]) #print("after:",tmp,words) if tmp==[] and..