/**
 * Given a list of rooms and a list of new elements, appends the new elements to the rooms list
 * starting from the start index and ending at the end index (exclusive). Returns the updated rooms list.
 *
 * @param rooms A list of rooms in the design.
 * @param newElements A list of new elements to be added to the rooms.
 * @param startIndex The index to start appending new elements from.
 * @param endIndex The index to stop appending new elements at (exclusive).
 * @return The updated design with new elements added to the specified range of rooms.
 *
 * Example:
 * updateDesign(listOf("living room", "kitchen", "bedroom"), listOf("bathroom", "study", "patio"), 1, 4)
 * Output: ['living room', 'kitchen', 'bathroom', 'study', 'patio']
 */
fun updateDesign(rooms: MutableList<String>, newElements: List<String>, startIndex: Int, endIndex: Int): List<String> {

    // Iterate over the range specified and append new elements to rooms list
    for (i in startIndex until endIndex) {
        rooms.add(newElements[i])
    }
    
    return rooms
}
/**
 * Given a list of rooms and a list of new elements, appends the new elements to the rooms list
 * starting from the start index and ending at the end index (exclusive). Returns the updated rooms list.
 *
 * @param rooms A list of rooms in the design.
 * @param newElements A list of new elements to be added to the rooms.
 * @param startIndex The index to start appending new elements from.
 * @param endIndex The index to stop appending new elements at (exclusive).
 * @return The updated design with new elements added to the specified range of rooms.
 *
 * Example:
 * updateDesign(listOf("living room", "kitchen", "bedroom"), listOf("bathroom", "study", "patio"), 1, 4)
 * Output: ['living room', 'kitchen', 'bathroom', 'study', 'patio']
 */
fun updateDesign(rooms: MutableList<String>, newElements: List<String>, startIndex: Int, endIndex: Int): List<String> {
/**
 * Given a list of rooms and a list of new elements, appends the new elements to the rooms list
 * starting from the start index and ending at the end index (exclusive). Returns the updated rooms list.
 *
 * @param rooms A list of rooms in the design.
 * @param newElements A list of new elements to be added to the rooms.
 * @param startIndex The index to start appending new elements from.
 * @param endIndex The index to stop appending new elements at (exclusive).
 * @return The updated design with new elements added to the specified range of rooms.
 *
 * Example:
 * updateDesign(listOf("living room", "kitchen", "bedroom"), listOf("bathroom", "study", "patio"), 1, 4)
 * Output: ['living room', 'kitchen', 'bathroom', 'study', 'patio']
 */
fun updateDesign(rooms: MutableList<String>, newElements: List<String>, startIndex: Int, endIndex: Int): List<String> {

    // Iterate over the range specified and append new elements to rooms list
    for (i in startIndex until endIndex) {
        rooms.add(newElements[i])
    }
    
    return rooms
}