/**
 * Given a nested list, multiply all elements by the given multiplier
 */
fun multiplyElements(nestedList: List<Any>, multiplier: Int): List<Any> {

    val multipliedList = mutableListOf<Any>()
    for (element in nestedList) {
        when (element) {
            is List<*> -> multipliedList.add(multiplyElements(element as List<Any>, multiplier))
            is Int -> {
                if (element % 2 == 0) {
                    multipliedList.add(element * 3)
                }
            }
        }
    }
    return multipliedList
}

// Exercise: Given a nested list of integers, filter out all odd numbers and multiply the remaining even numbers by 3.
/**
 * Given a nested list, multiply all elements by the given multiplier
 */
fun multiplyElements(nestedList: List<Any>, multiplier: Int): List<Any> {
/**
 * Given a nested list, multiply all elements by the given multiplier
 */
fun multiplyElements(nestedList: List<Any>, multiplier: Int): List<Any> {

    val multipliedList = mutableListOf<Any>()
    for (element in nestedList) {
        when (element) {
            is List<*> -> multipliedList.add(multiplyElements(element as List<Any>, multiplier))
            is Int -> {
                if (element % 2 == 0) {
                    multipliedList.add(element * 3)
                }
            }
        }
    }
    return multipliedList
}

// Exercise: Given a nested list of integers, filter out all odd numbers and multiply the remaining even numbers by 3.