You are viewing a single comment's thread. Return to all comments →
def f(l,index,target,cum): if len(cum)>len(target): return False if len(cum) == len(target): if cum == target: return True return False if index<0 or index>=len(l): return False pick = f(l,index+1,target,cum+l[index]) or f(l,index-1,target,cum+l[index]) or f(l,index,target,cum+l[index]) if pick: return True notpick = f(l,index+1,target,cum) or f(l,index-1,target,cum) if notpick: return True return False def passwordCracker(passwords, loginAttempt): if f(passwords, 0, loginAttempt,""): return loginAttempt return "WRONG PASSWORD"
I get infiite recursion. Please explain why
Seems like cookies are disabled on this browser, please enable them to open this website
Password Cracker
You are viewing a single comment's thread. Return to all comments →
I get infiite recursion. Please explain why