/**
 * Given two lists, find the intersection of the two lists using boolean expressions in loops.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return The intersection of list1 and list2.
 */
fun intersectionBoolExpressionsLoops(list1: List<Any>, list2: List<Any>): List<Any> {

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

    // Loop through each element in list1
    for (element in list1) {
        // Check if the element exists in list2
        if (list2.contains(element)) {
            // Check if the element does not already exist in the intersection list
            if (element !in intersection) {
                intersection.add(element)
            }
        }
    }

    return intersection
}
/**
 * Given two lists, find the intersection of the two lists using boolean expressions in loops.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return The intersection of list1 and list2.
 */
fun intersectionBoolExpressionsLoops(list1: List<Any>, list2: List<Any>): List<Any> {
/**
 * Given two lists, find the intersection of the two lists using boolean expressions in loops.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return The intersection of list1 and list2.
 */
fun intersectionBoolExpressionsLoops(list1: List<Any>, list2: List<Any>): List<Any> {

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

    // Loop through each element in list1
    for (element in list1) {
        // Check if the element exists in list2
        if (list2.contains(element)) {
            // Check if the element does not already exist in the intersection list
            if (element !in intersection) {
                intersection.add(element)
            }
        }
    }

    return intersection
}