/**
 * This function takes two lists as input and finds the common elements between them using the 'not in' operator.
 *
 * @param list1 The first list containing elements.
 * @param list2 The second list containing elements.
 * @return A list of common elements present in both lists.
 *
 * Example:
 * findCommonElements(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) // [3, 4]
 */
fun findCommonElements(list1: List<Int>, list2: List<Int>): List<Int> {

    val commonElements = mutableListOf<Int>()

    // Iterate through each element in list1
    for (elem in list1) {
        // Check if the element is not in list2
        if (elem !in list2) {
            // Add the element to the commonElements list
            commonElements.add(elem)
        }
    }

    // Iterate through each element in list2
    for (elem in list2) {
        // Check if the element is not in list1
        if (elem !in list1) {
            // Add the element to the commonElements list
            commonElements.add(elem)
        }
    }

    return commonElements
}
/**
 * This function takes two lists as input and finds the common elements between them using the 'not in' operator.
 *
 * @param list1 The first list containing elements.
 * @param list2 The second list containing elements.
 * @return A list of common elements present in both lists.
 *
 * Example:
 * findCommonElements(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) // [3, 4]
 */
fun findCommonElements(list1: List<Int>, list2: List<Int>): List<Int> {
/**
 * This function takes two lists as input and finds the common elements between them using the 'not in' operator.
 *
 * @param list1 The first list containing elements.
 * @param list2 The second list containing elements.
 * @return A list of common elements present in both lists.
 *
 * Example:
 * findCommonElements(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) // [3, 4]
 */
fun findCommonElements(list1: List<Int>, list2: List<Int>): List<Int> {

    val commonElements = mutableListOf<Int>()

    // Iterate through each element in list1
    for (elem in list1) {
        // Check if the element is not in list2
        if (elem !in list2) {
            // Add the element to the commonElements list
            commonElements.add(elem)
        }
    }

    // Iterate through each element in list2
    for (elem in list2) {
        // Check if the element is not in list1
        if (elem !in list1) {
            // Add the element to the commonElements list
            commonElements.add(elem)
        }
    }

    return commonElements
}