/**
 * Given two lists, find and return a new list containing the common elements between the two.
 */
fun findCommonElements(list1: List<Int>, list2: List<Int>): List<Int> {

    val commonElements = mutableListOf<Int>()

    // Iterate through list1
    for (num1 in list1) {
        if (num1 in list2 && num1 !in commonElements) {
            commonElements.add(num1)
        }
    }

    return commonElements
}
/**
 * Given two lists, find and return a new list containing the common elements between the two.
 */
fun findCommonElements(list1: List<Int>, list2: List<Int>): List<Int> {
/**
 * Given two lists, find and return a new list containing the common elements between the two.
 */
fun findCommonElements(list1: List<Int>, list2: List<Int>): List<Int> {

    val commonElements = mutableListOf<Int>()

    // Iterate through list1
    for (num1 in list1) {
        if (num1 in list2 && num1 !in commonElements) {
            commonElements.add(num1)
        }
    }

    return commonElements
}