/**
 * A function that checks the pollution level in a given city using a set of measurements.
 *
 * @param city The name of the city to check pollution level.
 * @param measurements A set of pollution measurements.
 * @return True if the pollution level is above the limit, False otherwise.
 */
fun checkPollution(city: String, measurements: Set<Pair<String, Int>>): Boolean {

    // Threshold pollution level
    val pollutionLimit = 50

    // Check if any measurement for the city is above the pollution limit
    for (measurement in measurements) {
        if (measurement.first == city) {
            if (measurement.second > pollutionLimit) {
                return true
            }
        }
    }

    // If no high pollution measurement found for the city, return false
    return false
}

// Sample measurements of pollution levels in different cities
val pollutionMeasurements = setOf(
    Pair("New York", 42), Pair("Los Angeles", 58), Pair("Chicago", 31),
    Pair("San Francisco", 45), Pair("Boston", 39), Pair("Seattle", 56)
)

// Check if the pollution level in 'Los Angeles' is above the limit
val aboveLimit = pollutionMeasurements.any { it.first == "Los Angeles" && it.second > 50 }
/**
 * A function that checks the pollution level in a given city using a set of measurements.
 *
 * @param city The name of the city to check pollution level.
 * @param measurements A set of pollution measurements.
 * @return True if the pollution level is above the limit, False otherwise.
 */
fun checkPollution(city: String, measurements: Set<Pair<String, Int>>): Boolean {
/**
 * A function that checks the pollution level in a given city using a set of measurements.
 *
 * @param city The name of the city to check pollution level.
 * @param measurements A set of pollution measurements.
 * @return True if the pollution level is above the limit, False otherwise.
 */
fun checkPollution(city: String, measurements: Set<Pair<String, Int>>): Boolean {

    // Threshold pollution level
    val pollutionLimit = 50

    // Check if any measurement for the city is above the pollution limit
    for (measurement in measurements) {
        if (measurement.first == city) {
            if (measurement.second > pollutionLimit) {
                return true
            }
        }
    }

    // If no high pollution measurement found for the city, return false
    return false
}

// Sample measurements of pollution levels in different cities
val pollutionMeasurements = setOf(
    Pair("New York", 42), Pair("Los Angeles", 58), Pair("Chicago", 31),
    Pair("San Francisco", 45), Pair("Boston", 39), Pair("Seattle", 56)
)

// Check if the pollution level in 'Los Angeles' is above the limit
val aboveLimit = pollutionMeasurements.any { it.first == "Los Angeles" && it.second > 50 }