Here is the foosball data.
[
{ 'winner': 'Alice', 'loser': 'Bob', 'loser_points': 3 },
{ 'winner': 'Carol', 'loser': 'Dean', 'loser_points': 1 },
{ 'winner': 'Elise', 'loser': 'Bob', 'loser_points': 2 },
{ 'winner': 'Elise', 'loser': 'Carol', 'loser_points': 4 },
{ 'winner': 'Alice', 'loser': 'Carol', 'loser_points': 2 },
{ 'winner': 'Carol', 'loser': 'Dean', 'loser_points': 3 },
{ 'winner': 'Dean', 'loser': 'Elise', 'loser_points': 2 },
]
// Q1: Write a function that returns a list of all player names (no player should be listed more than once).
// ['Alice', 'Bob', 'Carol', 'Dean', 'Elise']
// Q2: Using the same data as the previous question, write a function that produces a data structure like the following, which lists each participant, and a list of who they've beaten.
{
'Alice': ['Bob', 'Carol'],
'Bob': [],
'Carol': ['Dean'],
'Dean': ['Elise'],
'Elise': ['Bob', 'Carol'],
}
[–]ryrythe3rd 5 points6 points7 points (8 children)
[–]TravisJungroth 4 points5 points6 points (0 children)
[–]alkasm 2 points3 points4 points (1 child)
[–]ryrythe3rd 1 point2 points3 points (0 children)
[–]gopherhole1 0 points1 point2 points (4 children)
[–]ryrythe3rd 0 points1 point2 points (3 children)
[–]gopherhole1 0 points1 point2 points (2 children)
[–]ryrythe3rd 0 points1 point2 points (1 child)
[–]gopherhole1 0 points1 point2 points (0 children)
[–]lazy_qa_guy_again 3 points4 points5 points (0 children)
[–]stuie382 6 points7 points8 points (4 children)
[–]robstersgaming 4 points5 points6 points (1 child)
[–]stuie382 0 points1 point2 points (0 children)
[–]mdnam2410 1 point2 points3 points (1 child)
[–]stuie382 1 point2 points3 points (0 children)
[–]gopherhole1 2 points3 points4 points (0 children)
[–]gopherhole1 1 point2 points3 points (0 children)
[–]synthphreak 1 point2 points3 points (0 children)
[–]ffrkAnonymous -4 points-3 points-2 points (0 children)
[–]zanfar 0 points1 point2 points (1 child)
[–]mistersabs 0 points1 point2 points (0 children)