/**
 * Given a list of values and a factor, multiplies each value in the list with the factor and assigns the result
 * back to the list.
 *
 * @param data A list of values (can contain integers or floats)
 * @param factor A number (integer or float)
 * @return The modified list with the multiplied values
 *
 * Example:
 * multiplyAndAssignValues(listOf(2, 3, 4), 2) -> [4, 6, 8]
 * multiplyAndAssignValues(listOf(-1.5, 0, 1.75, -3.25), -0.5) -> [0.75, -0.0, -0.875, 1.625]
 */
fun multiplyAndAssignValues(data: List<Number>, factor: Number): List<Number> {

    // Create a new list to store the modified values
    val modifiedData = data.toMutableList()
    
    // Iterate through the elements of the list and multiply them with the factor
    for (i in modifiedData.indices) {
        modifiedData[i] = modifiedData[i].toDouble() * factor.toDouble()
    }
    
    return modifiedData
}
/**
 * Given a list of values and a factor, multiplies each value in the list with the factor and assigns the result
 * back to the list.
 *
 * @param data A list of values (can contain integers or floats)
 * @param factor A number (integer or float)
 * @return The modified list with the multiplied values
 *
 * Example:
 * multiplyAndAssignValues(listOf(2, 3, 4), 2) -> [4, 6, 8]
 * multiplyAndAssignValues(listOf(-1.5, 0, 1.75, -3.25), -0.5) -> [0.75, -0.0, -0.875, 1.625]
 */
fun multiplyAndAssignValues(data: List<Number>, factor: Number): List<Number> {
/**
 * Given a list of values and a factor, multiplies each value in the list with the factor and assigns the result
 * back to the list.
 *
 * @param data A list of values (can contain integers or floats)
 * @param factor A number (integer or float)
 * @return The modified list with the multiplied values
 *
 * Example:
 * multiplyAndAssignValues(listOf(2, 3, 4), 2) -> [4, 6, 8]
 * multiplyAndAssignValues(listOf(-1.5, 0, 1.75, -3.25), -0.5) -> [0.75, -0.0, -0.875, 1.625]
 */
fun multiplyAndAssignValues(data: List<Number>, factor: Number): List<Number> {

    // Create a new list to store the modified values
    val modifiedData = data.toMutableList()
    
    // Iterate through the elements of the list and multiply them with the factor
    for (i in modifiedData.indices) {
        modifiedData[i] = modifiedData[i].toDouble() * factor.toDouble()
    }
    
    return modifiedData
}