/**
 * Function to append even numbers to a list if num is even,
 * else append odd numbers to the list
 */
fun appendEvenNumbers(lst: MutableList<Int>, num: Int): List<Int> {

    if (num % 2 == 0) {
        lst.add(num)
        return lst
    } else {
        for (i in 0..num) {
            if (i % 2 == 0) {
                lst.add(i)
            }
        }
        return lst
    }
}
/**
 * Function to append even numbers to a list if num is even,
 * else append odd numbers to the list
 */
fun appendEvenNumbers(lst: MutableList<Int>, num: Int): List<Int> {
/**
 * Function to append even numbers to a list if num is even,
 * else append odd numbers to the list
 */
fun appendEvenNumbers(lst: MutableList<Int>, num: Int): List<Int> {

    if (num % 2 == 0) {
        lst.add(num)
        return lst
    } else {
        for (i in 0..num) {
            if (i % 2 == 0) {
                lst.add(i)
            }
        }
        return lst
    }
}