/**
 * Calculate the total expense for an interior designer by looping through a map of rooms
 * and combining it with another function that calculates the cost of furniture in each room.
 *
 * @param rooms A map of rooms with their corresponding areas.
 * @param furnitureCosts A map of furniture with their corresponding prices.
 * @return The total expense of the interior designer.
 *
 * This exercise is difficult as it involves complex map manipulation, nested loops,
 * and combining the loop with a function to calculate the cost of furniture in each room.
 */
fun calculateTotalExpense(rooms: Map<String, Int>, furnitureCosts: Map<String, Int>): Int {

    var totalExpense = 0

    for ((room, area) in rooms) {
        var furnitureCost = 0
        for ((furniture, price) in furnitureCosts) {
            if (furniture in room) {
                furnitureCost += price
            }
        }
        totalExpense += (area * furnitureCost)
    }

    return totalExpense
}

// Example usage
val rooms = mapOf(
    "Living Room" to 20,
    "Bedroom" to 15,
    "Kitchen" to 10
)

val furnitureCosts = mapOf(
    "Sofa" to 500,
    "Bed" to 1000,
    "Dining Table" to 800
)
/**
 * Calculate the total expense for an interior designer by looping through a map of rooms
 * and combining it with another function that calculates the cost of furniture in each room.
 *
 * @param rooms A map of rooms with their corresponding areas.
 * @param furnitureCosts A map of furniture with their corresponding prices.
 * @return The total expense of the interior designer.
 *
 * This exercise is difficult as it involves complex map manipulation, nested loops,
 * and combining the loop with a function to calculate the cost of furniture in each room.
 */
fun calculateTotalExpense(rooms: Map<String, Int>, furnitureCosts: Map<String, Int>): Int {
/**
 * Calculate the total expense for an interior designer by looping through a map of rooms
 * and combining it with another function that calculates the cost of furniture in each room.
 *
 * @param rooms A map of rooms with their corresponding areas.
 * @param furnitureCosts A map of furniture with their corresponding prices.
 * @return The total expense of the interior designer.
 *
 * This exercise is difficult as it involves complex map manipulation, nested loops,
 * and combining the loop with a function to calculate the cost of furniture in each room.
 */
fun calculateTotalExpense(rooms: Map<String, Int>, furnitureCosts: Map<String, Int>): Int {

    var totalExpense = 0

    for ((room, area) in rooms) {
        var furnitureCost = 0
        for ((furniture, price) in furnitureCosts) {
            if (furniture in room) {
                furnitureCost += price
            }
        }
        totalExpense += (area * furnitureCost)
    }

    return totalExpense
}

// Example usage
val rooms = mapOf(
    "Living Room" to 20,
    "Bedroom" to 15,
    "Kitchen" to 10
)

val furnitureCosts = mapOf(
    "Sofa" to 500,
    "Bed" to 1000,
    "Dining Table" to 800
)