/**
 * Given a list of countries and their populations, find the population of a specific country.
 *
 * @param countries A list of pairs containing the name and population of each country.
 * @param countryName The name of the country to find the population.
 * @return The population of the specified country, or 0 if the country was not found.
 *
 * Example:
 * val countries = listOf(Pair("United States", 331000000), Pair("China", 1444216107), Pair("India", 1393409038))
 * findCountryPopulation(countries, "China") // 1444216107
 */
fun findCountryPopulation(countries: List<Pair<String, Int>>, countryName: String): Int {

    // Loop through each country in the list of countries
    for (country in countries) {
        // Check if the country name matches the given countryName
        if (country.first == countryName) {
            // Return the population of the matched country
            return country.second
        }
    }
    // Return 0 if the country was not found
    return 0
}
/**
 * Given a list of countries and their populations, find the population of a specific country.
 *
 * @param countries A list of pairs containing the name and population of each country.
 * @param countryName The name of the country to find the population.
 * @return The population of the specified country, or 0 if the country was not found.
 *
 * Example:
 * val countries = listOf(Pair("United States", 331000000), Pair("China", 1444216107), Pair("India", 1393409038))
 * findCountryPopulation(countries, "China") // 1444216107
 */
fun findCountryPopulation(countries: List<Pair<String, Int>>, countryName: String): Int {
/**
 * Given a list of countries and their populations, find the population of a specific country.
 *
 * @param countries A list of pairs containing the name and population of each country.
 * @param countryName The name of the country to find the population.
 * @return The population of the specified country, or 0 if the country was not found.
 *
 * Example:
 * val countries = listOf(Pair("United States", 331000000), Pair("China", 1444216107), Pair("India", 1393409038))
 * findCountryPopulation(countries, "China") // 1444216107
 */
fun findCountryPopulation(countries: List<Pair<String, Int>>, countryName: String): Int {

    // Loop through each country in the list of countries
    for (country in countries) {
        // Check if the country name matches the given countryName
        if (country.first == countryName) {
            // Return the population of the matched country
            return country.second
        }
    }
    // Return 0 if the country was not found
    return 0
}