/**
 * This function takes two arrays as input and returns a list of common elements present in both arrays.
 *
 * @param array1 An array of integers representing the first set of elements.
 * @param array2 An array of integers representing the second set of elements.
 * @return A list of integers representing the common elements in both arrays.
 */
fun findCommonElements(array1: IntArray, array2: IntArray): List<Int> {

    val commonElements = mutableListOf<Int>()

    for (element1 in array1) {
        for (element2 in array2) {
            if (element1 == element2) {
                commonElements.add(element1)
            }
        }
    }

    return commonElements
}
/**
 * This function takes two arrays as input and returns a list of common elements present in both arrays.
 *
 * @param array1 An array of integers representing the first set of elements.
 * @param array2 An array of integers representing the second set of elements.
 * @return A list of integers representing the common elements in both arrays.
 */
fun findCommonElements(array1: IntArray, array2: IntArray): List<Int> {
/**
 * This function takes two arrays as input and returns a list of common elements present in both arrays.
 *
 * @param array1 An array of integers representing the first set of elements.
 * @param array2 An array of integers representing the second set of elements.
 * @return A list of integers representing the common elements in both arrays.
 */
fun findCommonElements(array1: IntArray, array2: IntArray): List<Int> {

    val commonElements = mutableListOf<Int>()

    for (element1 in array1) {
        for (element2 in array2) {
            if (element1 == element2) {
                commonElements.add(element1)
            }
        }
    }

    return commonElements
}