You are given a list of game metadata records. Build an in-memory representation that can store each game's name, release date, platforms, genre, publisher, optional country, and relevant Discord servers. Then implement lookup functions over the data.
Example input:
games = [
{
"name": "Cyber Quest",
"release_date": "2025-01-01",
"platform": ["playstation", "xbox"],
"genre": "RPG",
"publisher": "GameStudio A"
},
{
"name": "Battle Arena",
"release_date": "2024-11-15",
"platform": ["pc"],
"genre": "Action",
"publisher": "GameStudio B"
},
{
"name": "Sky Adventure",
"release_date": "2025-02-10",
"platform": ["playstation"],
"genre": "Adventure",
"publisher": "GameStudio A"
},
{
"name": "Mystery World",
"release_date": "2023-07-20",
"platform": ["xbox", "pc"],
"genre": "Puzzle",
"publisher": "GameStudio C"
},
{
"name": "Speed Racer",
"release_date": "2025-03-05",
"platform": ["pc", "playstation"],
"genre": "Racing",
"publisher": "GameStudio B"
}
]
Implement the following functions:
def get_genre(input_game):
"""Given a game name, return the genre of that game. Return None if not found."""
return None
def get_games(input_genre):
"""Given a genre, return a list of game names with that genre."""
result = []
return result
def get_most_available_games(games):
"""Return all game names that are available on the largest number of unique platforms."""
result = []
return result
def get_available_games(number_of_platform):
"""Return all game names that are available on exactly number_of_platform unique platforms."""
result = []
return result
Requirements:
-
Treat game-name and genre lookups as case-insensitive.
-
Count unique platforms for each game.
-
If multiple games tie for the largest number of platforms, return all of them.
-
Preserve the original game names in returned results.