/**
 * This exercise aims to test your knowledge on indexing tuples and iterating through them.
 * The task is to write a function that takes two tuples as input and returns a new tuple containing the common elements between the two given tuples.
 *
 * @param tuple1 The first input tuple.
 * @param tuple2 The second input tuple.
 * @return A new tuple containing the common elements between the two input tuples.
 *
 * Examples:
 * getCommonElements(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) // [3, 4]
 * getCommonElements(listOf('a', 'b', 'c', 'd'), listOf('c', 'd', 'e', 'f')) // ['c', 'd']
 */
fun getCommonElements(tuple1: List<Any>, tuple2: List<Any>): List<Any> {

    val commonElements = mutableListOf<Any>()
    for (element1 in tuple1) {
        for (element2 in tuple2) {
            if (element1 == element2) {
                commonElements.add(element1)
                break
            }
        }
    }
    return commonElements
}
/**
 * This exercise aims to test your knowledge on indexing tuples and iterating through them.
 * The task is to write a function that takes two tuples as input and returns a new tuple containing the common elements between the two given tuples.
 *
 * @param tuple1 The first input tuple.
 * @param tuple2 The second input tuple.
 * @return A new tuple containing the common elements between the two input tuples.
 *
 * Examples:
 * getCommonElements(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) // [3, 4]
 * getCommonElements(listOf('a', 'b', 'c', 'd'), listOf('c', 'd', 'e', 'f')) // ['c', 'd']
 */
fun getCommonElements(tuple1: List<Any>, tuple2: List<Any>): List<Any> {
/**
 * This exercise aims to test your knowledge on indexing tuples and iterating through them.
 * The task is to write a function that takes two tuples as input and returns a new tuple containing the common elements between the two given tuples.
 *
 * @param tuple1 The first input tuple.
 * @param tuple2 The second input tuple.
 * @return A new tuple containing the common elements between the two input tuples.
 *
 * Examples:
 * getCommonElements(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) // [3, 4]
 * getCommonElements(listOf('a', 'b', 'c', 'd'), listOf('c', 'd', 'e', 'f')) // ['c', 'd']
 */
fun getCommonElements(tuple1: List<Any>, tuple2: List<Any>): List<Any> {

    val commonElements = mutableListOf<Any>()
    for (element1 in tuple1) {
        for (element2 in tuple2) {
            if (element1 == element2) {
                commonElements.add(element1)
                break
            }
        }
    }
    return commonElements
}