/**
 * Given two lists, this function returns the intersection of the two lists.
 *
 * @param list1 First list
 * @param list2 Second list
 * @return Intersection of the two lists
 */
fun findIntersection(list1: List<Any>, list2: List<Any>): List<Any> {

    val intersection = mutableListOf<Any>()
    val list1Length = list1.size
    val list2Length = list2.size

    var i = 0
    while (i < list1Length) {
        var j = 0
        while (j < list2Length) {
            if (list1[i] == list2[j]) {
                intersection.add(list1[i])
                break
            }
            j++
        }
        i++
    }

    return intersection
}
/**
 * Given two lists, this function returns the intersection of the two lists.
 *
 * @param list1 First list
 * @param list2 Second list
 * @return Intersection of the two lists
 */
fun findIntersection(list1: List<Any>, list2: List<Any>): List<Any> {
/**
 * Given two lists, this function returns the intersection of the two lists.
 *
 * @param list1 First list
 * @param list2 Second list
 * @return Intersection of the two lists
 */
fun findIntersection(list1: List<Any>, list2: List<Any>): List<Any> {

    val intersection = mutableListOf<Any>()
    val list1Length = list1.size
    val list2Length = list2.size

    var i = 0
    while (i < list1Length) {
        var j = 0
        while (j < list2Length) {
            if (list1[i] == list2[j]) {
                intersection.add(list1[i])
                break
            }
            j++
        }
        i++
    }

    return intersection
}