/**
 * This exercise requires you to modify the elements of a list using indexing and boolean condition.
 *
 * Args:
 * - elements: a list of elements
 * - index: an integer representing the index of the element to be modified
 * - value: the new value that will replace the element at the given index
 * - condition: a boolean expression that should be True in order to perform modification
 *
 * Returns:
 * - The modified list of elements
 *
 * Instructions:
 * 1. Check if the boolean condition is True.
 * 2. If the condition is True, modify the element at the given index in the list with the provided value.
 * 3. If the condition is False, do not modify the list and return it as is.
 *
 * You need to complete the code below to solve this exercise.
 */
fun modifyElements(elements: MutableList<Int>, index: Int, value: Int, condition: Boolean): List<Int> {

    // Check if the condition is True
    if (condition) {
        // Modify the element at the given index with the provided value
        elements[index] = value
    }
    // Return the modified or original list
    return elements
}

// Example usage
/**
 * This exercise requires you to modify the elements of a list using indexing and boolean condition.
 *
 * Args:
 * - elements: a list of elements
 * - index: an integer representing the index of the element to be modified
 * - value: the new value that will replace the element at the given index
 * - condition: a boolean expression that should be True in order to perform modification
 *
 * Returns:
 * - The modified list of elements
 *
 * Instructions:
 * 1. Check if the boolean condition is True.
 * 2. If the condition is True, modify the element at the given index in the list with the provided value.
 * 3. If the condition is False, do not modify the list and return it as is.
 *
 * You need to complete the code below to solve this exercise.
 */
fun modifyElements(elements: MutableList<Int>, index: Int, value: Int, condition: Boolean): List<Int> {
/**
 * This exercise requires you to modify the elements of a list using indexing and boolean condition.
 *
 * Args:
 * - elements: a list of elements
 * - index: an integer representing the index of the element to be modified
 * - value: the new value that will replace the element at the given index
 * - condition: a boolean expression that should be True in order to perform modification
 *
 * Returns:
 * - The modified list of elements
 *
 * Instructions:
 * 1. Check if the boolean condition is True.
 * 2. If the condition is True, modify the element at the given index in the list with the provided value.
 * 3. If the condition is False, do not modify the list and return it as is.
 *
 * You need to complete the code below to solve this exercise.
 */
fun modifyElements(elements: MutableList<Int>, index: Int, value: Int, condition: Boolean): List<Int> {

    // Check if the condition is True
    if (condition) {
        // Modify the element at the given index with the provided value
        elements[index] = value
    }
    // Return the modified or original list
    return elements
}

// Example usage