You are viewing a single comment's thread. Return to all comments →
function passwordCracker(passwords, loginAttempt) {
const memo = {}; function helper(s) { if (s.length === 0) return []; if (memo[s] !== undefined) return memo[s]; for (let pwd of passwords) { if (s.startsWith(pwd)) { const rest = helper(s.slice(pwd.length)); if (rest !== null) { memo[s] = [pwd, ...rest]; return memo[s]; } } } memo[s] = null; return null; } const result = helper(loginAttempt); return result ? result.join(" ") : "WRONG PASSWORD";
}
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 →
function passwordCracker(passwords, loginAttempt) {
}