/**
 * Given two tuples, find the common elements between them.
 *
 * @param tuple1 The first tuple.
 * @param tuple2 The second tuple.
 * @return A list containing all the common elements.
 *
 * Example:
 * findCommonElements(listOf(1, 2, 3, 4, 5), listOf(4, 5, 6, 7, 8)) // [4, 5]
 */
fun findCommonElements(tuple1: List<Int>, tuple2: List<Int>): List<Int> {

    val commonElements = mutableListOf<Int>()

    for (element in tuple1) {
        if (element in tuple2 && element !in commonElements) {
            commonElements.add(element)
        }
    }

    return commonElements
}
/**
 * Given two tuples, find the common elements between them.
 *
 * @param tuple1 The first tuple.
 * @param tuple2 The second tuple.
 * @return A list containing all the common elements.
 *
 * Example:
 * findCommonElements(listOf(1, 2, 3, 4, 5), listOf(4, 5, 6, 7, 8)) // [4, 5]
 */
fun findCommonElements(tuple1: List<Int>, tuple2: List<Int>): List<Int> {
/**
 * Given two tuples, find the common elements between them.
 *
 * @param tuple1 The first tuple.
 * @param tuple2 The second tuple.
 * @return A list containing all the common elements.
 *
 * Example:
 * findCommonElements(listOf(1, 2, 3, 4, 5), listOf(4, 5, 6, 7, 8)) // [4, 5]
 */
fun findCommonElements(tuple1: List<Int>, tuple2: List<Int>): List<Int> {

    val commonElements = mutableListOf<Int>()

    for (element in tuple1) {
        if (element in tuple2 && element !in commonElements) {
            commonElements.add(element)
        }
    }

    return commonElements
}