/**
 * Given two lists: list1 and list2, the task is to find the intersection between the two.
 * The intersection is the common elements present in both lists.
 *
 * Complete the code below to implement the function that returns the intersection of the two lists.
 */
fun getIntersection(list1: List<Int>, list2: List<Int>): List<Int> {

    val intersection = mutableListOf<Int>()

    // Iterate through each element in list1
    for (element in list1) {
        // Check if the element is also present in list2
        // Note: Modify the condition below
        if (element in list2 && element !in intersection) {
            intersection.add(element)
        }
    }

    return intersection
}
/**
 * Given two lists: list1 and list2, the task is to find the intersection between the two.
 * The intersection is the common elements present in both lists.
 *
 * Complete the code below to implement the function that returns the intersection of the two lists.
 */
fun getIntersection(list1: List<Int>, list2: List<Int>): List<Int> {
/**
 * Given two lists: list1 and list2, the task is to find the intersection between the two.
 * The intersection is the common elements present in both lists.
 *
 * Complete the code below to implement the function that returns the intersection of the two lists.
 */
fun getIntersection(list1: List<Int>, list2: List<Int>): List<Int> {

    val intersection = mutableListOf<Int>()

    // Iterate through each element in list1
    for (element in list1) {
        // Check if the element is also present in list2
        // Note: Modify the condition below
        if (element in list2 && element !in intersection) {
            intersection.add(element)
        }
    }

    return intersection
}