/**
 * This function finds the common elements between two arrays using loops and conditional statements.
 *
 * @param t1 The first array.
 * @param t2 The second array.
 * @return A list containing the common elements between t1 and t2.
 */
fun findCommonElements(t1: Array<Int>, t2: Array<Int>): List<Int> {

    // Initialize an empty list to store the common elements
    val commonElements = mutableListOf<Int>()

    // Loop through the first array
    for (i in t1.indices) {
        // Loop through the second array
        for (j in t2.indices) {
            // Check if the current element in t1 is equal to the current element in t2
            if (t1[i] == t2[j]) {
                // Add the common element to the list
                commonElements.add(t1[i])
            }
        }
    }

    return commonElements
}
/**
 * This function finds the common elements between two arrays using loops and conditional statements.
 *
 * @param t1 The first array.
 * @param t2 The second array.
 * @return A list containing the common elements between t1 and t2.
 */
fun findCommonElements(t1: Array<Int>, t2: Array<Int>): List<Int> {
/**
 * This function finds the common elements between two arrays using loops and conditional statements.
 *
 * @param t1 The first array.
 * @param t2 The second array.
 * @return A list containing the common elements between t1 and t2.
 */
fun findCommonElements(t1: Array<Int>, t2: Array<Int>): List<Int> {

    // Initialize an empty list to store the common elements
    val commonElements = mutableListOf<Int>()

    // Loop through the first array
    for (i in t1.indices) {
        // Loop through the second array
        for (j in t2.indices) {
            // Check if the current element in t1 is equal to the current element in t2
            if (t1[i] == t2[j]) {
                // Add the common element to the list
                commonElements.add(t1[i])
            }
        }
    }

    return commonElements
}