You are organising a tennis tournament, albeit one in a strange format.
The TV rights holders hand you a list of singles matches (1v1) they want to see. To add drama, they also insist on a team element: every player is put on either Team A or Team B, and a player must never face someone from their own team.
Given the list of matchups, assign every player to a team.
matches = [["Alice", "Bob"], ["Charlie", "Alice"], ["David", "Bob"]]One valid answer:
Alice -> A
Bob -> B
David -> A
Charlie -> B
- Share your screen and work in a scratch editor (codeshare.io or similar).
- Think out loud. How you get there matters more than getting there.
- Ask me questions. The brief above is deliberately not exhaustive.
- Use any language you like, we want you to be comfortable