/**
 * This function takes a list of furniture and a map of corresponding prices,
 * and calculates the total cost of all the furniture items.
 *
 * @param furniture A list of furniture items.
 * @param prices A map of furniture items with their corresponding prices.
 * @return The total cost of all the furniture items.
 *
 * Example:
 * calculateTotalCost(listOf("Chair", "Sofa", "Table"), mapOf("Chair" to 100, "Sofa" to 500, "Table" to 250))
 * Output: 850.0
 */
fun calculateTotalCost(furniture: List<String>, prices: Map<String, Int>): Double {

    var totalCost = 0.0

    // Iterate over each furniture item in the list
    for (furnitureItem in furniture) {
        // Add the price of the furniture item to the total cost
        if (prices.containsKey(furnitureItem)) {
            totalCost += prices[furnitureItem] ?: 0
        }
    }

    return totalCost
}
/**
 * This function takes a list of furniture and a map of corresponding prices,
 * and calculates the total cost of all the furniture items.
 *
 * @param furniture A list of furniture items.
 * @param prices A map of furniture items with their corresponding prices.
 * @return The total cost of all the furniture items.
 *
 * Example:
 * calculateTotalCost(listOf("Chair", "Sofa", "Table"), mapOf("Chair" to 100, "Sofa" to 500, "Table" to 250))
 * Output: 850.0
 */
fun calculateTotalCost(furniture: List<String>, prices: Map<String, Int>): Double {
/**
 * This function takes a list of furniture and a map of corresponding prices,
 * and calculates the total cost of all the furniture items.
 *
 * @param furniture A list of furniture items.
 * @param prices A map of furniture items with their corresponding prices.
 * @return The total cost of all the furniture items.
 *
 * Example:
 * calculateTotalCost(listOf("Chair", "Sofa", "Table"), mapOf("Chair" to 100, "Sofa" to 500, "Table" to 250))
 * Output: 850.0
 */
fun calculateTotalCost(furniture: List<String>, prices: Map<String, Int>): Double {

    var totalCost = 0.0

    // Iterate over each furniture item in the list
    for (furnitureItem in furniture) {
        // Add the price of the furniture item to the total cost
        if (prices.containsKey(furnitureItem)) {
            totalCost += prices[furnitureItem] ?: 0
        }
    }

    return totalCost
}