/**
 * This function checks for the intersection of two sets
 * and returns the country and its capital if it is present in both sets.
 */
fun loopIntersection(countries: Set<String>, capitals: Set<String>): List<Pair<String, String>> {

    val common = mutableListOf<Pair<String, String>>() // list to store common countries and capitals

    // iterate through each country
    for (country in countries) {
        // iterate through each capital
        for (capital in capitals) {
            // check if the country or capital name contains an 'a' OR 'e' character,
            // and if the country and capital match
            if (('a' in country || 'e' in country) && country == capital) {
                // append the country and capital to the common list
                common.add(country to capital)
            }
        }
    }

    return common
}
/**
 * This function checks for the intersection of two sets
 * and returns the country and its capital if it is present in both sets.
 */
fun loopIntersection(countries: Set<String>, capitals: Set<String>): List<Pair<String, String>> {
/**
 * This function checks for the intersection of two sets
 * and returns the country and its capital if it is present in both sets.
 */
fun loopIntersection(countries: Set<String>, capitals: Set<String>): List<Pair<String, String>> {

    val common = mutableListOf<Pair<String, String>>() // list to store common countries and capitals

    // iterate through each country
    for (country in countries) {
        // iterate through each capital
        for (capital in capitals) {
            // check if the country or capital name contains an 'a' OR 'e' character,
            // and if the country and capital match
            if (('a' in country || 'e' in country) && country == capital) {
                // append the country and capital to the common list
                common.add(country to capital)
            }
        }
    }

    return common
}