/**
 * Given a nested dictionary of countries and their respective populations, this function
 * extracts specific population information based on the continent provided.
 *
 * @param countries A nested dictionary containing country names as keys and their respective populations as values.
 * @param continent The name of the continent for which population information is required.
 * @return A list of tuples containing the country name, its population, and a boolean value indicating if it is in the specified continent.
 */
fun extractPopulationInfo(countries: Map<String, Map<String, Any>>, continent: String): List<Triple<String, Int, Boolean>> {

    val populationInfo = mutableListOf<Triple<String, Int, Boolean>>()

    for ((country, populationData) in countries) {
        val countryContinent = populationData["continent"] as String?
        val isInContinent = countryContinent == continent
        populationInfo.add(Triple(country, populationData["population"] as Int, isInContinent))
    }

    return populationInfo
}
/**
 * Given a nested dictionary of countries and their respective populations, this function
 * extracts specific population information based on the continent provided.
 *
 * @param countries A nested dictionary containing country names as keys and their respective populations as values.
 * @param continent The name of the continent for which population information is required.
 * @return A list of tuples containing the country name, its population, and a boolean value indicating if it is in the specified continent.
 */
fun extractPopulationInfo(countries: Map<String, Map<String, Any>>, continent: String): List<Triple<String, Int, Boolean>> {
/**
 * Given a nested dictionary of countries and their respective populations, this function
 * extracts specific population information based on the continent provided.
 *
 * @param countries A nested dictionary containing country names as keys and their respective populations as values.
 * @param continent The name of the continent for which population information is required.
 * @return A list of tuples containing the country name, its population, and a boolean value indicating if it is in the specified continent.
 */
fun extractPopulationInfo(countries: Map<String, Map<String, Any>>, continent: String): List<Triple<String, Int, Boolean>> {

    val populationInfo = mutableListOf<Triple<String, Int, Boolean>>()

    for ((country, populationData) in countries) {
        val countryContinent = populationData["continent"] as String?
        val isInContinent = countryContinent == continent
        populationInfo.add(Triple(country, populationData["population"] as Int, isInContinent))
    }

    return populationInfo
}