|
|
back to boardHow I solved it! :D Hi! After 3 algorithms, I finally nailed it!. Don't try coloring, doesn't work. What I did: First, convert the teams onto nodes, and create ONE bidirectional edge between two teams when these team are sharing one or two contestants. Then, I make a pair array, and save, in decreasing order, the grades of the nodes ant their "names" (I used numbers). When I have that ordered array, I delete the nodes when have more than zero adjacent nodes. If have zero adjacent, means that the team is non-sharing any contestant. When you deleted a node, don't need to reorder the grades array. Finally, return the total initial nodes minus the times that I had deleted teams. Hope it helps you. Bye! |
|
|