/**
 * Given two lists, delete any duplicate elements from both lists.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return A pair of the modified list1 and list2 without duplicate elements.
 */
fun deleteDuplicates(list1: MutableList<Any>, list2: MutableList<Any>): Pair<MutableList<Any>, MutableList<Any>> {

    val iterator1 = list1.iterator()
    val iterator2 = list2.iterator()

    while (iterator1.hasNext()) {
        val element = iterator1.next()
        if (element in list2) {
            iterator1.remove()
            iterator2.remove()
        }
    }

    return Pair(list1, list2)
}
/**
 * Given two lists, delete any duplicate elements from both lists.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return A pair of the modified list1 and list2 without duplicate elements.
 */
fun deleteDuplicates(list1: MutableList<Any>, list2: MutableList<Any>): Pair<MutableList<Any>, MutableList<Any>> {
/**
 * Given two lists, delete any duplicate elements from both lists.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return A pair of the modified list1 and list2 without duplicate elements.
 */
fun deleteDuplicates(list1: MutableList<Any>, list2: MutableList<Any>): Pair<MutableList<Any>, MutableList<Any>> {

    val iterator1 = list1.iterator()
    val iterator2 = list2.iterator()

    while (iterator1.hasNext()) {
        val element = iterator1.next()
        if (element in list2) {
            iterator1.remove()
            iterator2.remove()
        }
    }

    return Pair(list1, list2)
}