/**
 * This function extracts specific data from a tuple based on given conditions.
 *
 * @param data A tuple containing nested tuples with information of journalists.
 * @return A tuple containing the names of journalists who have worked in different countries.
 *
 * Examples:
 * extractData(listOf(Pair("John", "USA"), Pair("Alice", "Canada"), Pair("Bob", "USA"), Pair("Mike", "Germany")))
 * Output: ("John", "Alice", "Bob", "Mike")
 */
fun extractData(data: List<Pair<String, String>>): List<String> {

    val countries = mutableSetOf<String>()
    val names = mutableListOf<String>()

    for (item in data) {
        val (name, country) = item
        if (country in countries) {
            continue
        } else {
            countries.add(country)
            names.add(name)
        }
    }

    return names
}
/**
 * This function extracts specific data from a tuple based on given conditions.
 *
 * @param data A tuple containing nested tuples with information of journalists.
 * @return A tuple containing the names of journalists who have worked in different countries.
 *
 * Examples:
 * extractData(listOf(Pair("John", "USA"), Pair("Alice", "Canada"), Pair("Bob", "USA"), Pair("Mike", "Germany")))
 * Output: ("John", "Alice", "Bob", "Mike")
 */
fun extractData(data: List<Pair<String, String>>): List<String> {
/**
 * This function extracts specific data from a tuple based on given conditions.
 *
 * @param data A tuple containing nested tuples with information of journalists.
 * @return A tuple containing the names of journalists who have worked in different countries.
 *
 * Examples:
 * extractData(listOf(Pair("John", "USA"), Pair("Alice", "Canada"), Pair("Bob", "USA"), Pair("Mike", "Germany")))
 * Output: ("John", "Alice", "Bob", "Mike")
 */
fun extractData(data: List<Pair<String, String>>): List<String> {

    val countries = mutableSetOf<String>()
    val names = mutableListOf<String>()

    for (item in data) {
        val (name, country) = item
        if (country in countries) {
            continue
        } else {
            countries.add(country)
            names.add(name)
        }
    }

    return names
}