/**
 * Given two lists 'lst1' and 'lst2', this function removes all elements from 'lst1' that appear in 'lst2'.
 * The function returns the modified 'lst1' without any duplicated elements.
 *
 * Example:
 * Input:
 * lst1 = [1, 2, 3, 4, 5, 6]
 * lst2 = [3, 4, 6, 7]
 * Output:
 * [1, 2, 5]
 *
 * Input:
 * lst1 = [10, 20, 30, 40, 50]
 * lst2 = [30, 50, 70]
 * Output:
 * [10, 20, 40]
 *
 * Note:
 * - The order of elements in the resulting list does not matter.
 * - You are not allowed to use built-in functions like set(), intersection(), etc.
 */
fun removeDuplicates(lst1: MutableList<Int>, lst2: List<Int>): List<Int> {

    val iterator = lst1.iterator()
    while (iterator.hasNext()) {
        val num = iterator.next()
        if (lst2.contains(num)) {
            iterator.remove()
        }
    }
    return lst1
}
/**
 * Given two lists 'lst1' and 'lst2', this function removes all elements from 'lst1' that appear in 'lst2'.
 * The function returns the modified 'lst1' without any duplicated elements.
 *
 * Example:
 * Input:
 * lst1 = [1, 2, 3, 4, 5, 6]
 * lst2 = [3, 4, 6, 7]
 * Output:
 * [1, 2, 5]
 *
 * Input:
 * lst1 = [10, 20, 30, 40, 50]
 * lst2 = [30, 50, 70]
 * Output:
 * [10, 20, 40]
 *
 * Note:
 * - The order of elements in the resulting list does not matter.
 * - You are not allowed to use built-in functions like set(), intersection(), etc.
 */
fun removeDuplicates(lst1: MutableList<Int>, lst2: List<Int>): List<Int> {
/**
 * Given two lists 'lst1' and 'lst2', this function removes all elements from 'lst1' that appear in 'lst2'.
 * The function returns the modified 'lst1' without any duplicated elements.
 *
 * Example:
 * Input:
 * lst1 = [1, 2, 3, 4, 5, 6]
 * lst2 = [3, 4, 6, 7]
 * Output:
 * [1, 2, 5]
 *
 * Input:
 * lst1 = [10, 20, 30, 40, 50]
 * lst2 = [30, 50, 70]
 * Output:
 * [10, 20, 40]
 *
 * Note:
 * - The order of elements in the resulting list does not matter.
 * - You are not allowed to use built-in functions like set(), intersection(), etc.
 */
fun removeDuplicates(lst1: MutableList<Int>, lst2: List<Int>): List<Int> {

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