/**
 * Given a fashion designer's catalogue of clothes, a list of desired colors, sizes, and maximal prices,
 * this function returns a list of trendy clothes that match any of the given criteria.
 *
 * @param catalogue A list of clothing items, each represented as a dictionary containing 'color', 'size', and 'price' keys.
 * @param colors A list of desired colors.
 * @param sizes A list of desired sizes.
 * @param prices A list of maximal prices.
 * @return A list of trendy clothes that satisfy any of the given criteria.
 */
fun findTrendyClothes(catalogue: List<Map<String, Any>>, colors: List<String>, sizes: List<String>, prices: List<Double>): List<Map<String, Any>> {

    val trendyClothes = mutableListOf<Map<String, Any>>()

    for (item in catalogue) {
        if (item["color"] in colors || item["size"] in sizes || item["price"] as Double <= prices.maxOrNull() ?: Double.MAX_VALUE) {
            trendyClothes.add(item)
        }
    }

    return trendyClothes
}
/**
 * Given a fashion designer's catalogue of clothes, a list of desired colors, sizes, and maximal prices,
 * this function returns a list of trendy clothes that match any of the given criteria.
 *
 * @param catalogue A list of clothing items, each represented as a dictionary containing 'color', 'size', and 'price' keys.
 * @param colors A list of desired colors.
 * @param sizes A list of desired sizes.
 * @param prices A list of maximal prices.
 * @return A list of trendy clothes that satisfy any of the given criteria.
 */
fun findTrendyClothes(catalogue: List<Map<String, Any>>, colors: List<String>, sizes: List<String>, prices: List<Double>): List<Map<String, Any>> {
/**
 * Given a fashion designer's catalogue of clothes, a list of desired colors, sizes, and maximal prices,
 * this function returns a list of trendy clothes that match any of the given criteria.
 *
 * @param catalogue A list of clothing items, each represented as a dictionary containing 'color', 'size', and 'price' keys.
 * @param colors A list of desired colors.
 * @param sizes A list of desired sizes.
 * @param prices A list of maximal prices.
 * @return A list of trendy clothes that satisfy any of the given criteria.
 */
fun findTrendyClothes(catalogue: List<Map<String, Any>>, colors: List<String>, sizes: List<String>, prices: List<Double>): List<Map<String, Any>> {

    val trendyClothes = mutableListOf<Map<String, Any>>()

    for (item in catalogue) {
        if (item["color"] in colors || item["size"] in sizes || item["price"] as Double <= prices.maxOrNull() ?: Double.MAX_VALUE) {
            trendyClothes.add(item)
        }
    }

    return trendyClothes
}