/**
 * Given a list of color palettes and a set of clothes,
 * this function returns a set containing common colors between the palettes
 * and the clothes.
 *
 * @param colorPalette A list of color palettes, represented as sets of colors.
 * @param clothes A set of clothing items, each represented as a color.
 * @return A set containing common colors between the palettes and the clothes.
 */
fun findCommonColors(colorPalette: List<Set<String>>, clothes: Set<String>): Set<String> {

    var commonColors: Set<String>? = null
    
    // Find common colors between the palettes and the clothes
    for (palette in colorPalette) {
        commonColors = commonColors?.intersect(palette)?.intersect(clothes) ?: palette.intersect(clothes)
    }
    
    return commonColors ?: emptySet()
}
/**
 * Given a list of color palettes and a set of clothes,
 * this function returns a set containing common colors between the palettes
 * and the clothes.
 *
 * @param colorPalette A list of color palettes, represented as sets of colors.
 * @param clothes A set of clothing items, each represented as a color.
 * @return A set containing common colors between the palettes and the clothes.
 */
fun findCommonColors(colorPalette: List<Set<String>>, clothes: Set<String>): Set<String> {
/**
 * Given a list of color palettes and a set of clothes,
 * this function returns a set containing common colors between the palettes
 * and the clothes.
 *
 * @param colorPalette A list of color palettes, represented as sets of colors.
 * @param clothes A set of clothing items, each represented as a color.
 * @return A set containing common colors between the palettes and the clothes.
 */
fun findCommonColors(colorPalette: List<Set<String>>, clothes: Set<String>): Set<String> {

    var commonColors: Set<String>? = null
    
    // Find common colors between the palettes and the clothes
    for (palette in colorPalette) {
        commonColors = commonColors?.intersect(palette)?.intersect(clothes) ?: palette.intersect(clothes)
    }
    
    return commonColors ?: emptySet()
}