3 ms·
Right, it could be a set of disjoint cycles instead. This constrains the problem less but I don't think it allows a simpler algorithm. Your approach still need
by dmurray 6y ago
Right, it could be a set of disjoint cycles instead.
This constrains the problem less but I don't think it allows a simpler algorithm. Your approach still needs some backtracking, if I understand right: what if Alice and Bob are the last two to be picked?