/**
 * Given two tuples, find the common elements between them.
 *
 * This function takes two tuples as input and returns a new tuple containing
 * the common elements found in both tuples. If there are no common elements,
 * it should return an empty tuple.
 *
 * @param firstTuple The first tuple.
 * @param secondTuple The second tuple.
 * @return A new tuple containing the common elements.
 *
 * Example:
 * findCommonElements(listOf(1, 2, 3), listOf(2, 3, 4)) // [2, 3]
 * findCommonElements(listOf('a', 'b', 'c'), listOf('d', 'e', 'f')) // []
 * findCommonElements(listOf('x', 'x', 'y'), listOf('y', 'y', 'z')) // ['y']
 */
fun findCommonElements(firstTuple: List<Any>, secondTuple: List<Any>): List<Any> {

    val commonElements = mutableListOf<Any>()

    for (element in firstTuple) {
        if (element in secondTuple) {
            commonElements.add(element)
        }
    }

    return commonElements
}
/**
 * Given two tuples, find the common elements between them.
 *
 * This function takes two tuples as input and returns a new tuple containing
 * the common elements found in both tuples. If there are no common elements,
 * it should return an empty tuple.
 *
 * @param firstTuple The first tuple.
 * @param secondTuple The second tuple.
 * @return A new tuple containing the common elements.
 *
 * Example:
 * findCommonElements(listOf(1, 2, 3), listOf(2, 3, 4)) // [2, 3]
 * findCommonElements(listOf('a', 'b', 'c'), listOf('d', 'e', 'f')) // []
 * findCommonElements(listOf('x', 'x', 'y'), listOf('y', 'y', 'z')) // ['y']
 */
fun findCommonElements(firstTuple: List<Any>, secondTuple: List<Any>): List<Any> {
/**
 * Given two tuples, find the common elements between them.
 *
 * This function takes two tuples as input and returns a new tuple containing
 * the common elements found in both tuples. If there are no common elements,
 * it should return an empty tuple.
 *
 * @param firstTuple The first tuple.
 * @param secondTuple The second tuple.
 * @return A new tuple containing the common elements.
 *
 * Example:
 * findCommonElements(listOf(1, 2, 3), listOf(2, 3, 4)) // [2, 3]
 * findCommonElements(listOf('a', 'b', 'c'), listOf('d', 'e', 'f')) // []
 * findCommonElements(listOf('x', 'x', 'y'), listOf('y', 'y', 'z')) // ['y']
 */
fun findCommonElements(firstTuple: List<Any>, secondTuple: List<Any>): List<Any> {

    val commonElements = mutableListOf<Any>()

    for (element in firstTuple) {
        if (element in secondTuple) {
            commonElements.add(element)
        }
    }

    return commonElements
}