/**
 * This function finds the intersection of two lists using the 'AND operator' and 'Not Equal' condition.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return A list of elements that are common to both list1 and list2 but are not equal.
 *
 * Example:
 * findIntersectAndNotEqual(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) // [3, 4]
 */
fun findIntersectAndNotEqual(list1: List<Int>, list2: List<Int>): List<Int> {

    val intersection = mutableListOf<Int>()

    // Iterate over each element in list1
    for (element1 in list1) {
        // Iterate over each element in list2
        for (element2 in list2) {
            // Check if both elements are equal
            if (element1 == element2) {
                // Check if both elements are not equal
                if (element1 != element2) {
                    // Add the element to the intersection list
                    intersection.add(element1)
                }
            }
        }
    }

    return intersection
}
/**
 * This function finds the intersection of two lists using the 'AND operator' and 'Not Equal' condition.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return A list of elements that are common to both list1 and list2 but are not equal.
 *
 * Example:
 * findIntersectAndNotEqual(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) // [3, 4]
 */
fun findIntersectAndNotEqual(list1: List<Int>, list2: List<Int>): List<Int> {
/**
 * This function finds the intersection of two lists using the 'AND operator' and 'Not Equal' condition.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return A list of elements that are common to both list1 and list2 but are not equal.
 *
 * Example:
 * findIntersectAndNotEqual(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) // [3, 4]
 */
fun findIntersectAndNotEqual(list1: List<Int>, list2: List<Int>): List<Int> {

    val intersection = mutableListOf<Int>()

    // Iterate over each element in list1
    for (element1 in list1) {
        // Iterate over each element in list2
        for (element2 in list2) {
            // Check if both elements are equal
            if (element1 == element2) {
                // Check if both elements are not equal
                if (element1 != element2) {
                    // Add the element to the intersection list
                    intersection.add(element1)
                }
            }
        }
    }

    return intersection
}