/**
 * Given a dictionary of fashion items and a tuple of colors, the function should return a list of
 * items that have all the colors mentioned in the tuple.
 *
 * The dictionary 'fashionDict" has the fashion items as keys and the corresponding colors as values.
 * The tuple 'colorsTuple" contains the colors that should be present in the fashion items.
 *
 * @param fashionDict The dictionary of fashion items and their colors.
 * @param colorsTuple The tuple of colors to check for in the fashion items.
 * @return A list of items that have all the colors mentioned in the tuple.
 *
 * Example:
 * fashionDict = mapOf(
 *     "dress" to listOf("red", "blue", "green"),
 *     "pants" to listOf("blue", "green"),
 *     "shirt" to listOf("red", "blue", "white"),
 *     "shoes" to listOf("black", "red")
 * )
 * colorsTuple = listOf("red", "blue")
 *
 * Output:
 * ['dress', 'shirt']
 *
 * Note: The colors in the tuple must be present in a fashion item for it to be included in the output list.
 *
 * Difficulty: Hard
 */
fun findCommonColors(fashionDict: Map<String, List<String>>, colorsTuple: List<String>): List<String> {

    val commonItems = mutableListOf<String>()

    for ((item, colors) in fashionDict) {
        if (colorsTuple.all { colors.contains(it) }) {
            commonItems.add(item)
        }
    }

    return commonItems
}
/**
 * Given a dictionary of fashion items and a tuple of colors, the function should return a list of
 * items that have all the colors mentioned in the tuple.
 *
 * The dictionary 'fashionDict" has the fashion items as keys and the corresponding colors as values.
 * The tuple 'colorsTuple" contains the colors that should be present in the fashion items.
 *
 * @param fashionDict The dictionary of fashion items and their colors.
 * @param colorsTuple The tuple of colors to check for in the fashion items.
 * @return A list of items that have all the colors mentioned in the tuple.
 *
 * Example:
 * fashionDict = mapOf(
 *     "dress" to listOf("red", "blue", "green"),
 *     "pants" to listOf("blue", "green"),
 *     "shirt" to listOf("red", "blue", "white"),
 *     "shoes" to listOf("black", "red")
 * )
 * colorsTuple = listOf("red", "blue")
 *
 * Output:
 * ['dress', 'shirt']
 *
 * Note: The colors in the tuple must be present in a fashion item for it to be included in the output list.
 *
 * Difficulty: Hard
 */
fun findCommonColors(fashionDict: Map<String, List<String>>, colorsTuple: List<String>): List<String> {
/**
 * Given a dictionary of fashion items and a tuple of colors, the function should return a list of
 * items that have all the colors mentioned in the tuple.
 *
 * The dictionary 'fashionDict" has the fashion items as keys and the corresponding colors as values.
 * The tuple 'colorsTuple" contains the colors that should be present in the fashion items.
 *
 * @param fashionDict The dictionary of fashion items and their colors.
 * @param colorsTuple The tuple of colors to check for in the fashion items.
 * @return A list of items that have all the colors mentioned in the tuple.
 *
 * Example:
 * fashionDict = mapOf(
 *     "dress" to listOf("red", "blue", "green"),
 *     "pants" to listOf("blue", "green"),
 *     "shirt" to listOf("red", "blue", "white"),
 *     "shoes" to listOf("black", "red")
 * )
 * colorsTuple = listOf("red", "blue")
 *
 * Output:
 * ['dress', 'shirt']
 *
 * Note: The colors in the tuple must be present in a fashion item for it to be included in the output list.
 *
 * Difficulty: Hard
 */
fun findCommonColors(fashionDict: Map<String, List<String>>, colorsTuple: List<String>): List<String> {

    val commonItems = mutableListOf<String>()

    for ((item, colors) in fashionDict) {
        if (colorsTuple.all { colors.contains(it) }) {
            commonItems.add(item)
        }
    }

    return commonItems
}