/**
 * Given a list of elements and a factor, multiply each element in the list by the factor,
 * then return the modified list.
 *
 * @param elements A list of elements.
 * @param factor A number to multiply each element by.
 * @return The modified list with multiplied elements.
 *
 * Examples:
 * modifyListElements(listOf(1, 2, 3, 4), 2) -> [2, 4, 6, 8]
 * modifyListElements(listOf(-1, -2, -3, -4), -3) -> [3, 6, 9, 12]
 * modifyListElements(listOf(0, 5, 10, 15), 0) -> [0, 0, 0, 0]
 */
fun modifyListElements(elements: List<Int>, factor: Int): List<Int> {

    val modifiedList = mutableListOf<Int>()  // Initialize an empty list to store the modified elements

    // Multiply each element in the list by the factor and add it to the modifiedList
    for (element in elements) {
        modifiedList.add(element * factor)
    }

    return modifiedList
}
/**
 * Given a list of elements and a factor, multiply each element in the list by the factor,
 * then return the modified list.
 *
 * @param elements A list of elements.
 * @param factor A number to multiply each element by.
 * @return The modified list with multiplied elements.
 *
 * Examples:
 * modifyListElements(listOf(1, 2, 3, 4), 2) -> [2, 4, 6, 8]
 * modifyListElements(listOf(-1, -2, -3, -4), -3) -> [3, 6, 9, 12]
 * modifyListElements(listOf(0, 5, 10, 15), 0) -> [0, 0, 0, 0]
 */
fun modifyListElements(elements: List<Int>, factor: Int): List<Int> {
/**
 * Given a list of elements and a factor, multiply each element in the list by the factor,
 * then return the modified list.
 *
 * @param elements A list of elements.
 * @param factor A number to multiply each element by.
 * @return The modified list with multiplied elements.
 *
 * Examples:
 * modifyListElements(listOf(1, 2, 3, 4), 2) -> [2, 4, 6, 8]
 * modifyListElements(listOf(-1, -2, -3, -4), -3) -> [3, 6, 9, 12]
 * modifyListElements(listOf(0, 5, 10, 15), 0) -> [0, 0, 0, 0]
 */
fun modifyListElements(elements: List<Int>, factor: Int): List<Int> {

    val modifiedList = mutableListOf<Int>()  // Initialize an empty list to store the modified elements

    // Multiply each element in the list by the factor and add it to the modifiedList
    for (element in elements) {
        modifiedList.add(element * factor)
    }

    return modifiedList
}