/**
 * Given two lists lst1 and lst2, this function modifies lst1 by removing any elements that are also present in lst2.
 * The modified lst1 is returned.
 *
 * For example:
 * modifyList(listOf(1, 2, 3, 4, 5), listOf(2, 4, 6)) should return [1, 3, 5]
 * modifyList(listOf(10, 20, 30, 40, 50), listOf(40, 60, 80)) should return [10, 20, 30, 50]
 */
fun modifyList(lst1: MutableList<Int>, lst2: List<Int>): List<Int> {

    val iterator = lst1.iterator()
    while (iterator.hasNext()) {
        val element = iterator.next()
        if (lst2.contains(element)) {
            iterator.remove()
        }
    }
    return lst1
}
/**
 * Given two lists lst1 and lst2, this function modifies lst1 by removing any elements that are also present in lst2.
 * The modified lst1 is returned.
 *
 * For example:
 * modifyList(listOf(1, 2, 3, 4, 5), listOf(2, 4, 6)) should return [1, 3, 5]
 * modifyList(listOf(10, 20, 30, 40, 50), listOf(40, 60, 80)) should return [10, 20, 30, 50]
 */
fun modifyList(lst1: MutableList<Int>, lst2: List<Int>): List<Int> {
/**
 * Given two lists lst1 and lst2, this function modifies lst1 by removing any elements that are also present in lst2.
 * The modified lst1 is returned.
 *
 * For example:
 * modifyList(listOf(1, 2, 3, 4, 5), listOf(2, 4, 6)) should return [1, 3, 5]
 * modifyList(listOf(10, 20, 30, 40, 50), listOf(40, 60, 80)) should return [10, 20, 30, 50]
 */
fun modifyList(lst1: MutableList<Int>, lst2: List<Int>): List<Int> {

    val iterator = lst1.iterator()
    while (iterator.hasNext()) {
        val element = iterator.next()
        if (lst2.contains(element)) {
            iterator.remove()
        }
    }
    return lst1
}