/**
 * This function takes a list of numbers and a list of operations as input,
 * and modifies the elements in the list based on the operations.
 *
 * @param numbers List of integers.
 * @param operations List of operations.
 * @return Modified list of integers.
 */
fun modifyElements(numbers: List<Int>, operations: List<String>): List<Int> {

    var result = numbers.toMutableList()
    for (operation in operations) {
        result = when (operation) {
            "square" -> result.map { it * it }
            "increment" -> result.map { it + 1 }
            "negate" -> result.map { -it }
            "multiply" -> result.map { it * 2 }
            "decrement" -> result.map { it - 1 }
            "divide" -> result.map { it / 2 }
            else -> result
        }.toMutableList()
    }
    return result
}
/**
 * This function takes a list of numbers and a list of operations as input,
 * and modifies the elements in the list based on the operations.
 *
 * @param numbers List of integers.
 * @param operations List of operations.
 * @return Modified list of integers.
 */
fun modifyElements(numbers: List<Int>, operations: List<String>): List<Int> {
/**
 * This function takes a list of numbers and a list of operations as input,
 * and modifies the elements in the list based on the operations.
 *
 * @param numbers List of integers.
 * @param operations List of operations.
 * @return Modified list of integers.
 */
fun modifyElements(numbers: List<Int>, operations: List<String>): List<Int> {

    var result = numbers.toMutableList()
    for (operation in operations) {
        result = when (operation) {
            "square" -> result.map { it * it }
            "increment" -> result.map { it + 1 }
            "negate" -> result.map { -it }
            "multiply" -> result.map { it * 2 }
            "decrement" -> result.map { it - 1 }
            "divide" -> result.map { it / 2 }
            else -> result
        }.toMutableList()
    }
    return result
}