/**
 * Given two lists, lst1 and lst2, return the count of elements that appear in both lists.
 * After counting, remove these common elements from both lists.
 *
 * @param lst1 A list of elements.
 * @param lst2 A list of elements.
 * @return The count of common elements and the modified lists after removing common elements.
 */
fun intersectCountDelete(lst1: MutableList<Any>, lst2: MutableList<Any>): Triple<Int, MutableList<Any>, MutableList<Any>> {

    var count = 0
    var i = 0
    while (i < lst1.size) {
        var j = 0
        while (j < lst2.size) {
            if (lst1[i] == lst2[j]) {
                count++
                lst1.removeAt(i)
                lst2.removeAt(j)
            } else {
                j++
            }
        }
        i++
    }
    return Triple(count, lst1, lst2)
}
/**
 * Given two lists, lst1 and lst2, return the count of elements that appear in both lists.
 * After counting, remove these common elements from both lists.
 *
 * @param lst1 A list of elements.
 * @param lst2 A list of elements.
 * @return The count of common elements and the modified lists after removing common elements.
 */
fun intersectCountDelete(lst1: MutableList<Any>, lst2: MutableList<Any>): Triple<Int, MutableList<Any>, MutableList<Any>> {
/**
 * Given two lists, lst1 and lst2, return the count of elements that appear in both lists.
 * After counting, remove these common elements from both lists.
 *
 * @param lst1 A list of elements.
 * @param lst2 A list of elements.
 * @return The count of common elements and the modified lists after removing common elements.
 */
fun intersectCountDelete(lst1: MutableList<Any>, lst2: MutableList<Any>): Triple<Int, MutableList<Any>, MutableList<Any>> {

    var count = 0
    var i = 0
    while (i < lst1.size) {
        var j = 0
        while (j < lst2.size) {
            if (lst1[i] == lst2[j]) {
                count++
                lst1.removeAt(i)
                lst2.removeAt(j)
            } else {
                j++
            }
        }
        i++
    }
    return Triple(count, lst1, lst2)
}