/**
 * A biomedical engineer is working with a list of elements and needs to append new elements to it based on a given condition.
 * Complete the function to append a new element, 'newElement', to the 'elementsList' only if the 'condition' is true.
 * Return the modified 'elementsList'.
 */
fun appendNewElements(elementsList: List<Int>, condition: Boolean, newElement: Int): List<Int> {

    // Initialize a mutable list to store the modified elements
    val modifiedList = elementsList.toMutableList()

    // Check if the condition is true and append the new element to the modifiedList
    if (condition) {
        modifiedList.add(newElement)
    }

    // Return the modified list
    return modifiedList
}

// Example usage
/**
 * A biomedical engineer is working with a list of elements and needs to append new elements to it based on a given condition.
 * Complete the function to append a new element, 'newElement', to the 'elementsList' only if the 'condition' is true.
 * Return the modified 'elementsList'.
 */
fun appendNewElements(elementsList: List<Int>, condition: Boolean, newElement: Int): List<Int> {
/**
 * A biomedical engineer is working with a list of elements and needs to append new elements to it based on a given condition.
 * Complete the function to append a new element, 'newElement', to the 'elementsList' only if the 'condition' is true.
 * Return the modified 'elementsList'.
 */
fun appendNewElements(elementsList: List<Int>, condition: Boolean, newElement: Int): List<Int> {

    // Initialize a mutable list to store the modified elements
    val modifiedList = elementsList.toMutableList()

    // Check if the condition is true and append the new element to the modifiedList
    if (condition) {
        modifiedList.add(newElement)
    }

    // Return the modified list
    return modifiedList
}

// Example usage