/**
 * Given a list of countries and their respective GDPs, return a list containing the countries with the highest GDPs.
 *
 * @param countries A list of countries.
 * @param gdp A list of corresponding GDP values for each country.
 * @return A list of countries with the highest GDPs.
 *
 * Example:
 * getHighestGDPCountries(listOf("USA", "China", "Germany", "Japan", "France"), listOf(21500, 14100, 4125, 5080, 2830))
 * Returns: ['USA', 'China']
 */
fun getHighestGDPCountries(countries: List<String>, gdp: List<Int>): List<String> {

    // Find the highest GDP value
    val highestGDP = gdp.maxOrNull()

    // Use filter to get the countries with the highest GDP
    return countries.filterIndexed { index, _ -> gdp[index] == highestGDP }
}
/**
 * Given a list of countries and their respective GDPs, return a list containing the countries with the highest GDPs.
 *
 * @param countries A list of countries.
 * @param gdp A list of corresponding GDP values for each country.
 * @return A list of countries with the highest GDPs.
 *
 * Example:
 * getHighestGDPCountries(listOf("USA", "China", "Germany", "Japan", "France"), listOf(21500, 14100, 4125, 5080, 2830))
 * Returns: ['USA', 'China']
 */
fun getHighestGDPCountries(countries: List<String>, gdp: List<Int>): List<String> {
/**
 * Given a list of countries and their respective GDPs, return a list containing the countries with the highest GDPs.
 *
 * @param countries A list of countries.
 * @param gdp A list of corresponding GDP values for each country.
 * @return A list of countries with the highest GDPs.
 *
 * Example:
 * getHighestGDPCountries(listOf("USA", "China", "Germany", "Japan", "France"), listOf(21500, 14100, 4125, 5080, 2830))
 * Returns: ['USA', 'China']
 */
fun getHighestGDPCountries(countries: List<String>, gdp: List<Int>): List<String> {

    // Find the highest GDP value
    val highestGDP = gdp.maxOrNull()

    // Use filter to get the countries with the highest GDP
    return countries.filterIndexed { index, _ -> gdp[index] == highestGDP }
}