/**
 * You are an interior designer working on a renovation project.
 * You have a list of rooms and the length of the walls in those rooms.
 * Your task is to calculate the total used space in all the rooms.
 *
 * @param rooms A list of room names.
 * @param walls A list of integers representing the length of walls in each room.
 *              The index of each item in 'walls' corresponds to the respective room's index in 'rooms'.
 * @return The sum of all the wall lengths, excluding any negative values.
 *
 * Example:
 * rooms = ['Living Room', 'Bedroom', 'Kitchen']
 * walls = [10, -5, 20]
 * calculateUsedSpace(rooms, walls) should return 30
 * (10 + 0 + 20, since the negative value for the Bedroom is ignored)
 */
fun calculateUsedSpace(rooms: List<String>, walls: List<Int>): Int {

    var totalUsedSpace = 0

    for ((index, wall) in walls.withIndex()) {
        if (wall > 0) {
            totalUsedSpace += wall
        }
    }

    return totalUsedSpace
}
/**
 * You are an interior designer working on a renovation project.
 * You have a list of rooms and the length of the walls in those rooms.
 * Your task is to calculate the total used space in all the rooms.
 *
 * @param rooms A list of room names.
 * @param walls A list of integers representing the length of walls in each room.
 *              The index of each item in 'walls' corresponds to the respective room's index in 'rooms'.
 * @return The sum of all the wall lengths, excluding any negative values.
 *
 * Example:
 * rooms = ['Living Room', 'Bedroom', 'Kitchen']
 * walls = [10, -5, 20]
 * calculateUsedSpace(rooms, walls) should return 30
 * (10 + 0 + 20, since the negative value for the Bedroom is ignored)
 */
fun calculateUsedSpace(rooms: List<String>, walls: List<Int>): Int {
/**
 * You are an interior designer working on a renovation project.
 * You have a list of rooms and the length of the walls in those rooms.
 * Your task is to calculate the total used space in all the rooms.
 *
 * @param rooms A list of room names.
 * @param walls A list of integers representing the length of walls in each room.
 *              The index of each item in 'walls' corresponds to the respective room's index in 'rooms'.
 * @return The sum of all the wall lengths, excluding any negative values.
 *
 * Example:
 * rooms = ['Living Room', 'Bedroom', 'Kitchen']
 * walls = [10, -5, 20]
 * calculateUsedSpace(rooms, walls) should return 30
 * (10 + 0 + 20, since the negative value for the Bedroom is ignored)
 */
fun calculateUsedSpace(rooms: List<String>, walls: List<Int>): Int {

    var totalUsedSpace = 0

    for ((index, wall) in walls.withIndex()) {
        if (wall > 0) {
            totalUsedSpace += wall
        }
    }

    return totalUsedSpace
}