/**
 * This function calculates the total cost of all the items in each room for an interior designer.
 * The input is a nested list 'rooms' containing the items and their costs for each room.
 *
 * Example:
 * rooms = [['chair', 100], ['sofa', 500], ['table', 200]],
 *         [['bed', 900], ['rug', 300], ['lamp', 100]]
 *
 * Output:
 * Total cost for room 1: 800
 * Total cost for room 2: 1300
 * Grand Total: 2100
 *
 * You need to complete the code to find the totals as shown in the example.
 */
fun calculateTotalCost(rooms: List<List<Pair<String, Int>>>) {

    var grandTotal = 0

    for (i in rooms.indices) {
        var roomTotal = 0

        for (j in rooms[i].indices) {
            val item = rooms[i][j].first
            val cost = rooms[i][j].second

            // Calculate the total cost for each room
            roomTotal += cost
        }

        // Print the total cost for each room
        println("Total cost for room ${i + 1}: $roomTotal")

        // Calculate the
    }
}
/**
 * This function calculates the total cost of all the items in each room for an interior designer.
 * The input is a nested list 'rooms' containing the items and their costs for each room.
 *
 * Example:
 * rooms = [['chair', 100], ['sofa', 500], ['table', 200]],
 *         [['bed', 900], ['rug', 300], ['lamp', 100]]
 *
 * Output:
 * Total cost for room 1: 800
 * Total cost for room 2: 1300
 * Grand Total: 2100
 *
 * You need to complete the code to find the totals as shown in the example.
 */
fun calculateTotalCost(rooms: List<List<Pair<String, Int>>>) {
/**
 * This function calculates the total cost of all the items in each room for an interior designer.
 * The input is a nested list 'rooms' containing the items and their costs for each room.
 *
 * Example:
 * rooms = [['chair', 100], ['sofa', 500], ['table', 200]],
 *         [['bed', 900], ['rug', 300], ['lamp', 100]]
 *
 * Output:
 * Total cost for room 1: 800
 * Total cost for room 2: 1300
 * Grand Total: 2100
 *
 * You need to complete the code to find the totals as shown in the example.
 */
fun calculateTotalCost(rooms: List<List<Pair<String, Int>>>) {

    var grandTotal = 0

    for (i in rooms.indices) {
        var roomTotal = 0

        for (j in rooms[i].indices) {
            val item = rooms[i][j].first
            val cost = rooms[i][j].second

            // Calculate the total cost for each room
            roomTotal += cost
        }

        // Print the total cost for each room
        println("Total cost for room ${i + 1}: $roomTotal")

        // Calculate the
    }
}