/**
 * Given two lists, find the intersection using the 'AND' operator.
 *
 * @param list1 First list containing elements
 * @param list2 Second list containing elements
 * @return A new list containing the intersection of the two input lists
 */
fun intersectionLists(list1: List<Any>, list2: List<Any>): List<Any> {

    // Initialize an empty list to store the intersection
    val intersection = mutableListOf<Any>()

    // Loop through the elements in list1
    for (element in list1) {
        // Check if the element is also present in list2
        if (element in list2 && element !in intersection) {
            // Append the element to the intersection list
            intersection.add(element)
        }
    }

    return intersection
}
/**
 * Given two lists, find the intersection using the 'AND' operator.
 *
 * @param list1 First list containing elements
 * @param list2 Second list containing elements
 * @return A new list containing the intersection of the two input lists
 */
fun intersectionLists(list1: List<Any>, list2: List<Any>): List<Any> {
/**
 * Given two lists, find the intersection using the 'AND' operator.
 *
 * @param list1 First list containing elements
 * @param list2 Second list containing elements
 * @return A new list containing the intersection of the two input lists
 */
fun intersectionLists(list1: List<Any>, list2: List<Any>): List<Any> {

    // Initialize an empty list to store the intersection
    val intersection = mutableListOf<Any>()

    // Loop through the elements in list1
    for (element in list1) {
        // Check if the element is also present in list2
        if (element in list2 && element !in intersection) {
            // Append the element to the intersection list
            intersection.add(element)
        }
    }

    return intersection
}