/**
 * Given two arrays of integers, find the common elements between them.
 *
 * @param array1 The first array.
 * @param array2 The second array.
 * @return A list containing the common elements between the two arrays.
 */
fun findCommonElements(array1: List<Int>, array2: List<Int>): List<Int> {

    val commonElements = mutableListOf<Int>()

    // Iterate over the elements in array1
    for (element in array1) {
        // Check if the element is present in array2
        if (element in array2) {
            // Add the element to the commonElements list
            commonElements.add(element)
        }
    }

    return commonElements
}
/**
 * Given two arrays of integers, find the common elements between them.
 *
 * @param array1 The first array.
 * @param array2 The second array.
 * @return A list containing the common elements between the two arrays.
 */
fun findCommonElements(array1: List<Int>, array2: List<Int>): List<Int> {
/**
 * Given two arrays of integers, find the common elements between them.
 *
 * @param array1 The first array.
 * @param array2 The second array.
 * @return A list containing the common elements between the two arrays.
 */
fun findCommonElements(array1: List<Int>, array2: List<Int>): List<Int> {

    val commonElements = mutableListOf<Int>()

    // Iterate over the elements in array1
    for (element in array1) {
        // Check if the element is present in array2
        if (element in array2) {
            // Add the element to the commonElements list
            commonElements.add(element)
        }
    }

    return commonElements
}