/**
 * Given an array and the number of updates, update each element of the array
 * by multiplying it by the number of updates.
 *
 * @param array The original array.
 * @param numUpdates The number of updates to be performed on each element.
 * @return The updated array.
 */
fun updateArray(array: List<Int>, numUpdates: Int): List<Int> {

    // Raise an exception if the input array is empty
    if (array.isEmpty()) {
        throw IllegalArgumentException("Input array cannot be empty!")
    }
    
    // Raise an exception if the number of updates is negative
    if (numUpdates < 0) {
        throw IllegalArgumentException("Number of updates cannot be negative!")
    }
    
    // Create a new array to store the updated values
    val updatedArray = mutableListOf<Int>()
    
    // Iterate over each element in the original array
    for (element in array) {
        // Multiply each element by the number of updates and add it to the updated array
        val updatedElement = element * numUpdates
        updatedArray.add(updatedElement)
    }
    
    // Return the updated array
    return updatedArray
}
/**
 * Given an array and the number of updates, update each element of the array
 * by multiplying it by the number of updates.
 *
 * @param array The original array.
 * @param numUpdates The number of updates to be performed on each element.
 * @return The updated array.
 */
fun updateArray(array: List<Int>, numUpdates: Int): List<Int> {
/**
 * Given an array and the number of updates, update each element of the array
 * by multiplying it by the number of updates.
 *
 * @param array The original array.
 * @param numUpdates The number of updates to be performed on each element.
 * @return The updated array.
 */
fun updateArray(array: List<Int>, numUpdates: Int): List<Int> {

    // Raise an exception if the input array is empty
    if (array.isEmpty()) {
        throw IllegalArgumentException("Input array cannot be empty!")
    }
    
    // Raise an exception if the number of updates is negative
    if (numUpdates < 0) {
        throw IllegalArgumentException("Number of updates cannot be negative!")
    }
    
    // Create a new array to store the updated values
    val updatedArray = mutableListOf<Int>()
    
    // Iterate over each element in the original array
    for (element in array) {
        // Multiply each element by the number of updates and add it to the updated array
        val updatedElement = element * numUpdates
        updatedArray.add(updatedElement)
    }
    
    // Return the updated array
    return updatedArray
}