/**
 * This function takes a list of firefighters and a set of fire locations as input.
 * It assigns each firefighter to a fire location and returns a list of tuples containing the firefighter's name
 * and the fire location they are assigned to.
 *
 * @param firefighters A list of firefighter names
 * @param fireLocations A set of fire locations
 * @return A list of tuples containing the firefighter's name and the fire location they are assigned to
 */
fun extinguishFires(firefighters: List<String>, fireLocations: Set<String>): List<Pair<String, String>> {

    val assignments = mutableListOf<Pair<String, String>>()

    firefighters.forEach { firefighter ->
        fireLocations.find { location ->
            firefighter !in assignments.map { it.first }
        }?.let { location ->
            assignments.add(firefighter to location)
        }
    }

    return assignments
}
/**
 * This function takes a list of firefighters and a set of fire locations as input.
 * It assigns each firefighter to a fire location and returns a list of tuples containing the firefighter's name
 * and the fire location they are assigned to.
 *
 * @param firefighters A list of firefighter names
 * @param fireLocations A set of fire locations
 * @return A list of tuples containing the firefighter's name and the fire location they are assigned to
 */
fun extinguishFires(firefighters: List<String>, fireLocations: Set<String>): List<Pair<String, String>> {
/**
 * This function takes a list of firefighters and a set of fire locations as input.
 * It assigns each firefighter to a fire location and returns a list of tuples containing the firefighter's name
 * and the fire location they are assigned to.
 *
 * @param firefighters A list of firefighter names
 * @param fireLocations A set of fire locations
 * @return A list of tuples containing the firefighter's name and the fire location they are assigned to
 */
fun extinguishFires(firefighters: List<String>, fireLocations: Set<String>): List<Pair<String, String>> {

    val assignments = mutableListOf<Pair<String, String>>()

    firefighters.forEach { firefighter ->
        fireLocations.find { location ->
            firefighter !in assignments.map { it.first }
        }?.let { location ->
            assignments.add(firefighter to location)
        }
    }

    return assignments
}