Cs50 Tideman Solution «Best | SUMMARY»

if (locked[loser][i]) if (creates_cycle(winner, i)) return true;

So the correct helper:

return true;

Here is a template and a drafted post you can use or adapt. It focuses on the hardest part of the problem: the sort_pairs and lock_pairs functions. Cs50 Tideman Solution