A game keeps scores as a simple dictionary, like {"Ana": 40, "Ben": 55}. To share it, you'll save a leaderboard as JSON in this nested shape:
1{"players": [{"name": "Ben", "points": 55}, {"name": "Ana", "points": 40}]}
Write save_leaderboard(path, scores) that:
{"name": ..., "points": ...} dictionary per player"players" list by points, highest first. If two players have the same points, the name that comes first A to Z goes first.path with json.dumpjson.load and returns the "players" list from what it readIf scores is empty, save {"players": []} and return []. Don't change the scores dictionary you were given.