/**
 * Given a dictionary of fashion brands and a list of similar brands,
 * return a new dictionary containing only the fashion brands that are more popular
 * than any of the similar brands.
 *
 * @param fashionBrands Dictionary containing fashion brands as keys and their popularity as values.
 * @param similarBrands List of similar fashion brands.
 * @return A new dictionary containing the fashion brands that are more popular
 * than any of the similar brands.
 */
fun findSimilarBrands(fashionBrands: Map<String, Int>, similarBrands: List<String>): Map<String, Int> {

    val popularBrands = mutableMapOf<String, Int>()

    for ((brand, popularity) in fashionBrands) {
        val maxPopularity = similarBrands.mapNotNull { fashionBrands[it] }.maxOrNull() ?: 0
        if (popularity > maxPopularity) {
            popularBrands[brand] = popularity
        }
    }

    return popularBrands
}

// Example usage
/**
 * Given a dictionary of fashion brands and a list of similar brands,
 * return a new dictionary containing only the fashion brands that are more popular
 * than any of the similar brands.
 *
 * @param fashionBrands Dictionary containing fashion brands as keys and their popularity as values.
 * @param similarBrands List of similar fashion brands.
 * @return A new dictionary containing the fashion brands that are more popular
 * than any of the similar brands.
 */
fun findSimilarBrands(fashionBrands: Map<String, Int>, similarBrands: List<String>): Map<String, Int> {
/**
 * Given a dictionary of fashion brands and a list of similar brands,
 * return a new dictionary containing only the fashion brands that are more popular
 * than any of the similar brands.
 *
 * @param fashionBrands Dictionary containing fashion brands as keys and their popularity as values.
 * @param similarBrands List of similar fashion brands.
 * @return A new dictionary containing the fashion brands that are more popular
 * than any of the similar brands.
 */
fun findSimilarBrands(fashionBrands: Map<String, Int>, similarBrands: List<String>): Map<String, Int> {

    val popularBrands = mutableMapOf<String, Int>()

    for ((brand, popularity) in fashionBrands) {
        val maxPopularity = similarBrands.mapNotNull { fashionBrands[it] }.maxOrNull() ?: 0
        if (popularity > maxPopularity) {
            popularBrands[brand] = popularity
        }
    }

    return popularBrands
}

// Example usage