/**
 * Given two lists a and b, this function deletes the common elements from both lists in-place.
 * It returns the modified lists.
 *
 * @param a The first list containing elements
 * @param b The second list containing elements
 * @return Pair of modified lists: the modified list a after deleting common elements and the modified list b after deleting common elements
 */
fun deleteCommonElements(a: MutableList<Any>, b: MutableList<Any>): Pair<MutableList<Any>, MutableList<Any>> {

    val commonElements = mutableListOf<Any>()

    // Find the common elements
    for (elementA in a.toList()) {
        for (elementB in b.toList()) {
            if (elementA == elementB) {
                commonElements.add(elementA)
            }
        }
    }

    // Delete the common elements from list a
    for (element in commonElements) {
        a.remove(element)
    }

    // Delete the common elements from list b
    for (element in commonElements) {
        b.remove(element)
    }

    return Pair(a, b)
}
/**
 * Given two lists a and b, this function deletes the common elements from both lists in-place.
 * It returns the modified lists.
 *
 * @param a The first list containing elements
 * @param b The second list containing elements
 * @return Pair of modified lists: the modified list a after deleting common elements and the modified list b after deleting common elements
 */
fun deleteCommonElements(a: MutableList<Any>, b: MutableList<Any>): Pair<MutableList<Any>, MutableList<Any>> {
/**
 * Given two lists a and b, this function deletes the common elements from both lists in-place.
 * It returns the modified lists.
 *
 * @param a The first list containing elements
 * @param b The second list containing elements
 * @return Pair of modified lists: the modified list a after deleting common elements and the modified list b after deleting common elements
 */
fun deleteCommonElements(a: MutableList<Any>, b: MutableList<Any>): Pair<MutableList<Any>, MutableList<Any>> {

    val commonElements = mutableListOf<Any>()

    // Find the common elements
    for (elementA in a.toList()) {
        for (elementB in b.toList()) {
            if (elementA == elementB) {
                commonElements.add(elementA)
            }
        }
    }

    // Delete the common elements from list a
    for (element in commonElements) {
        a.remove(element)
    }

    // Delete the common elements from list b
    for (element in commonElements) {
        b.remove(element)
    }

    return Pair(a, b)
}