/**
 * The function counts the number of items in a list that have a specific color.
 *
 * @param items list of items
 * @param color color of items to search for
 * @return number of items with the given color
 */
fun countItems(items: List<Map<String, String>>, color: String): Int {

    var count = 0

    for (item in items) {
        if (item["color"] == color) {
            count++
        }
    }

    return count
}

// Fashion Designer

// Products list containing maps for each item
val products = listOf(
    mapOf("name" to "Dress", "color" to "red", "price" to "59.99"),
    mapOf("name" to "Trousers", "color" to "blue", "price" to "39.99"),
    mapOf("name" to "Blouse", "color" to "green", "price" to "29.99"),
    mapOf("name" to "Skirt", "color" to "red", "price" to "49.99"),
    mapOf("name" to "Shirt", "color" to "blue", "price" to "34.99")
)
/**
 * The function counts the number of items in a list that have a specific color.
 *
 * @param items list of items
 * @param color color of items to search for
 * @return number of items with the given color
 */
fun countItems(items: List<Map<String, String>>, color: String): Int {
/**
 * The function counts the number of items in a list that have a specific color.
 *
 * @param items list of items
 * @param color color of items to search for
 * @return number of items with the given color
 */
fun countItems(items: List<Map<String, String>>, color: String): Int {

    var count = 0

    for (item in items) {
        if (item["color"] == color) {
            count++
        }
    }

    return count
}

// Fashion Designer

// Products list containing maps for each item
val products = listOf(
    mapOf("name" to "Dress", "color" to "red", "price" to "59.99"),
    mapOf("name" to "Trousers", "color" to "blue", "price" to "39.99"),
    mapOf("name" to "Blouse", "color" to "green", "price" to "29.99"),
    mapOf("name" to "Skirt", "color" to "red", "price" to "49.99"),
    mapOf("name" to "Shirt", "color" to "blue", "price" to "34.99")
)