/**
 * This function calculates the total area of a room given a dictionary of its dimensions.
 */
fun calculateRoomArea(roomDimensions: MutableMap<String, Pair<Int, Int>>): Int {

    var totalArea = 0

    while (roomDimensions.isNotEmpty()) {
        val room = roomDimensions.entries.first()
        val length = room.value.first
        val width = room.value.second
        val area = length * width
        totalArea += area
        roomDimensions.remove(room.key)
    }

    return totalArea
}

val roomDimensions = mutableMapOf(
    "living_room" to Pair(6, 8),
    "kitchen" to Pair(4, 5),
    "bedroom" to Pair(5, 7),
    "bathroom" to Pair(3, 4)
)

// Code completion exercise starts here
/**
 * This function calculates the total area of a room given a dictionary of its dimensions.
 */
fun calculateRoomArea(roomDimensions: MutableMap<String, Pair<Int, Int>>): Int {
/**
 * This function calculates the total area of a room given a dictionary of its dimensions.
 */
fun calculateRoomArea(roomDimensions: MutableMap<String, Pair<Int, Int>>): Int {

    var totalArea = 0

    while (roomDimensions.isNotEmpty()) {
        val room = roomDimensions.entries.first()
        val length = room.value.first
        val width = room.value.second
        val area = length * width
        totalArea += area
        roomDimensions.remove(room.key)
    }

    return totalArea
}

val roomDimensions = mutableMapOf(
    "living_room" to Pair(6, 8),
    "kitchen" to Pair(4, 5),
    "bedroom" to Pair(5, 7),
    "bathroom" to Pair(3, 4)
)

// Code completion exercise starts here