/**
 * You are a game developer and want to filter game options based on minimum ratings and genres.
 * Complete the code to modify the given map 'gameOptions' according to the following criteria:
 *
 * 1. Keep only the games from 'gameOptions' that have a rating greater than or equal to the 'minimumRatings'.
 * 2. Keep only the games from 'gameOptions' that have genres present in the 'genres' list.
 *
 * Your task is to complete the code by using nested logical operators and modifying values in the map 'gameOptions'.
 * Return the modified 'gameOptions' map.
 */
fun filterGameOptions(gameOptions: Map<String, Map<String, Any>>, minimumRatings: Int, genres: List<String>): Map<String, Map<String, Any>> {

    val filteredGameOptions = mutableMapOf<String, Map<String, Any>>()

    for ((game, attributes) in gameOptions) {
        if (attributes["rating"] as Int >= minimumRatings && attributes["genre"] as String in genres) {
            filteredGameOptions[game] = attributes
        }
    }

    return filteredGameOptions
}

// Example usage
val gameOptions = mapOf(
    "Game 1" to mapOf("rating" to 8, "genre" to "Action"),
    "Game 2" to mapOf("rating" to 7, "genre" to "Strategy"),
    "Game 3" to mapOf("rating" to 6, "genre" to "Adventure")
)
/**
 * You are a game developer and want to filter game options based on minimum ratings and genres.
 * Complete the code to modify the given map 'gameOptions' according to the following criteria:
 *
 * 1. Keep only the games from 'gameOptions' that have a rating greater than or equal to the 'minimumRatings'.
 * 2. Keep only the games from 'gameOptions' that have genres present in the 'genres' list.
 *
 * Your task is to complete the code by using nested logical operators and modifying values in the map 'gameOptions'.
 * Return the modified 'gameOptions' map.
 */
fun filterGameOptions(gameOptions: Map<String, Map<String, Any>>, minimumRatings: Int, genres: List<String>): Map<String, Map<String, Any>> {
/**
 * You are a game developer and want to filter game options based on minimum ratings and genres.
 * Complete the code to modify the given map 'gameOptions' according to the following criteria:
 *
 * 1. Keep only the games from 'gameOptions' that have a rating greater than or equal to the 'minimumRatings'.
 * 2. Keep only the games from 'gameOptions' that have genres present in the 'genres' list.
 *
 * Your task is to complete the code by using nested logical operators and modifying values in the map 'gameOptions'.
 * Return the modified 'gameOptions' map.
 */
fun filterGameOptions(gameOptions: Map<String, Map<String, Any>>, minimumRatings: Int, genres: List<String>): Map<String, Map<String, Any>> {

    val filteredGameOptions = mutableMapOf<String, Map<String, Any>>()

    for ((game, attributes) in gameOptions) {
        if (attributes["rating"] as Int >= minimumRatings && attributes["genre"] as String in genres) {
            filteredGameOptions[game] = attributes
        }
    }

    return filteredGameOptions
}

// Example usage
val gameOptions = mapOf(
    "Game 1" to mapOf("rating" to 8, "genre" to "Action"),
    "Game 2" to mapOf("rating" to 7, "genre" to "Strategy"),
    "Game 3" to mapOf("rating" to 6, "genre" to "Adventure")
)