/**
 * This function takes in two lists, list1 and list2, and returns a new list that contains the common elements between the two lists.
 *
 * Your task is to complete the body of the code, which should loop through the elements of list1 and check if each element is not present in list2 using the 'not in' operator. If the element is not present, it should be added to the new list.
 *
 * The code to solve the exercise should be included at the end.
 */
fun findCommonElements(list1: List<Int>, list2: List<Int>): List<Int> {

    val commonElements = mutableListOf<Int>()

    for (element1 in list1) {
        if (element1 !in list2) {
            commonElements.add(element1)
        }
    }

    return commonElements
}
/**
 * This function takes in two lists, list1 and list2, and returns a new list that contains the common elements between the two lists.
 *
 * Your task is to complete the body of the code, which should loop through the elements of list1 and check if each element is not present in list2 using the 'not in' operator. If the element is not present, it should be added to the new list.
 *
 * The code to solve the exercise should be included at the end.
 */
fun findCommonElements(list1: List<Int>, list2: List<Int>): List<Int> {
/**
 * This function takes in two lists, list1 and list2, and returns a new list that contains the common elements between the two lists.
 *
 * Your task is to complete the body of the code, which should loop through the elements of list1 and check if each element is not present in list2 using the 'not in' operator. If the element is not present, it should be added to the new list.
 *
 * The code to solve the exercise should be included at the end.
 */
fun findCommonElements(list1: List<Int>, list2: List<Int>): List<Int> {

    val commonElements = mutableListOf<Int>()

    for (element1 in list1) {
        if (element1 !in list2) {
            commonElements.add(element1)
        }
    }

    return commonElements
}