/**
 * Given two lists, find the intersection of elements using the 'AND operator' and 'Identity Comparison'.
 *
 * @param list1 A list of elements.
 * @param list2 Another list of elements.
 * @return A list containing the intersection of elements from list1 and list2.
 *
 * Example:
 * intersectionAndOperatorIdentityComparison(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) returns [3, 4]
 */
fun intersectionAndOperatorIdentityComparison(list1: List<Int>, list2: List<Int>): List<Int> {

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

    // Iterate over the elements in list1
    for (element in list1) {
        // Check if the element is present in list2 and not already in the intersection list
        if (element in list2 && element !in intersection) {
            // Add the element to the intersection list
            intersection.add(element)
        }
    }

    // Return the intersection list
    return intersection
}
/**
 * Given two lists, find the intersection of elements using the 'AND operator' and 'Identity Comparison'.
 *
 * @param list1 A list of elements.
 * @param list2 Another list of elements.
 * @return A list containing the intersection of elements from list1 and list2.
 *
 * Example:
 * intersectionAndOperatorIdentityComparison(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) returns [3, 4]
 */
fun intersectionAndOperatorIdentityComparison(list1: List<Int>, list2: List<Int>): List<Int> {
/**
 * Given two lists, find the intersection of elements using the 'AND operator' and 'Identity Comparison'.
 *
 * @param list1 A list of elements.
 * @param list2 Another list of elements.
 * @return A list containing the intersection of elements from list1 and list2.
 *
 * Example:
 * intersectionAndOperatorIdentityComparison(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) returns [3, 4]
 */
fun intersectionAndOperatorIdentityComparison(list1: List<Int>, list2: List<Int>): List<Int> {

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

    // Iterate over the elements in list1
    for (element in list1) {
        // Check if the element is present in list2 and not already in the intersection list
        if (element in list2 && element !in intersection) {
            // Add the element to the intersection list
            intersection.add(element)
        }
    }

    // Return the intersection list
    return intersection
}