Maya rewrote her function. No more hardcoding two steps. She used a visited array and a recursive dfs(candidate) :
function cycle(start, target): // Base case: If start == target, we found a cycle. if start == target: return true // Recursive case: Check every candidate. for each candidate i: if locked[start][i] is true: if cycle(i, target): return true Cs50 Tideman Solution
array (containing every head-to-head win), you must sort them by the strength of the victory. The Logic: Maya rewrote her function
}