/**
 * This function calculates the total floor area of a building.
 *
 * @param rooms a list of dictionaries where each dictionary represents a room and has the following keys:
 *              'name': a string representing the name of the room
 *              'length': a float representing the length of the room in meters
 *              'width': a float representing the width of the room in meters
 * @return the total floor area of the building in square meters
 */
fun calculateFloorArea(rooms: List<Map<String, Any>>): Float {

    var totalArea = 0f

    for (room in rooms) {
        // Check if the room is a corridor or an empty space
        if (room["name"] == "corridor" || room["name"] == "empty") {
            continue  // Skip this iteration and move to the next room
        }

        // Calculate the area of the room
        val area = room["length"] as Float * room["width"] as Float

        // If the area is too small, stop calculating the area and return a negative value
        if (area < 10) {
            // Modify the code below to return -1 and break out of the loop
            return -1f
        }

        // Add the room area to the total area
        totalArea += area
    }

    return totalArea
}
/**
 * This function calculates the total floor area of a building.
 *
 * @param rooms a list of dictionaries where each dictionary represents a room and has the following keys:
 *              'name': a string representing the name of the room
 *              'length': a float representing the length of the room in meters
 *              'width': a float representing the width of the room in meters
 * @return the total floor area of the building in square meters
 */
fun calculateFloorArea(rooms: List<Map<String, Any>>): Float {
/**
 * This function calculates the total floor area of a building.
 *
 * @param rooms a list of dictionaries where each dictionary represents a room and has the following keys:
 *              'name': a string representing the name of the room
 *              'length': a float representing the length of the room in meters
 *              'width': a float representing the width of the room in meters
 * @return the total floor area of the building in square meters
 */
fun calculateFloorArea(rooms: List<Map<String, Any>>): Float {

    var totalArea = 0f

    for (room in rooms) {
        // Check if the room is a corridor or an empty space
        if (room["name"] == "corridor" || room["name"] == "empty") {
            continue  // Skip this iteration and move to the next room
        }

        // Calculate the area of the room
        val area = room["length"] as Float * room["width"] as Float

        // If the area is too small, stop calculating the area and return a negative value
        if (area < 10) {
            // Modify the code below to return -1 and break out of the loop
            return -1f
        }

        // Add the room area to the total area
        totalArea += area
    }

    return totalArea
}