/**
 * This exercise tests your understanding of indexing tuples and using set comprehension.
 *
 * Given two tuples, you need to find the common elements present in both tuples and return them as a set.
 *
 * @param tuple1 The first tuple
 * @param tuple2 The second tuple
 * @return A set containing the common elements in both tuples
 *
 * Example:
 *
 * findCommonElements(listOf(1, 2, 3), listOf(2, 3, 4)) -> setOf(2, 3)
 * findCommonElements(listOf("a", "b", "c", "d"), listOf("c", "d", "e", "f")) -> setOf("c", "d")
 * findCommonElements(listOf(1, "hello", true), listOf(1.5, "hello", false)) -> setOf("hello")
 */
fun findCommonElements(tuple1: List<Any>, tuple2: List<Any>): Set<Any> {

    // Use indexing to find common elements in both tuples
    val commonElements = tuple1.filter { it in tuple2 }.toSet()
    return commonElements
}
/**
 * This exercise tests your understanding of indexing tuples and using set comprehension.
 *
 * Given two tuples, you need to find the common elements present in both tuples and return them as a set.
 *
 * @param tuple1 The first tuple
 * @param tuple2 The second tuple
 * @return A set containing the common elements in both tuples
 *
 * Example:
 *
 * findCommonElements(listOf(1, 2, 3), listOf(2, 3, 4)) -> setOf(2, 3)
 * findCommonElements(listOf("a", "b", "c", "d"), listOf("c", "d", "e", "f")) -> setOf("c", "d")
 * findCommonElements(listOf(1, "hello", true), listOf(1.5, "hello", false)) -> setOf("hello")
 */
fun findCommonElements(tuple1: List<Any>, tuple2: List<Any>): Set<Any> {
/**
 * This exercise tests your understanding of indexing tuples and using set comprehension.
 *
 * Given two tuples, you need to find the common elements present in both tuples and return them as a set.
 *
 * @param tuple1 The first tuple
 * @param tuple2 The second tuple
 * @return A set containing the common elements in both tuples
 *
 * Example:
 *
 * findCommonElements(listOf(1, 2, 3), listOf(2, 3, 4)) -> setOf(2, 3)
 * findCommonElements(listOf("a", "b", "c", "d"), listOf("c", "d", "e", "f")) -> setOf("c", "d")
 * findCommonElements(listOf(1, "hello", true), listOf(1.5, "hello", false)) -> setOf("hello")
 */
fun findCommonElements(tuple1: List<Any>, tuple2: List<Any>): Set<Any> {

    // Use indexing to find common elements in both tuples
    val commonElements = tuple1.filter { it in tuple2 }.toSet()
    return commonElements
}