/**
 * This exercise requires finding the intersection of two tuples using the logical AND operator and slicing tuples.
 *
 * Given two tuples, tuple1 and tuple2, the function should return a new tuple that contains only the elements present in both tuple1 and tuple2.
 *
 * @param tuple1 The first tuple.
 * @param tuple2 The second tuple.
 * @return A new tuple containing the common elements from tuple1 and tuple2.
 *
 * Example:
 * intersectionAndOperatorSlicingTuples(listOf('a', 'b', 'c', 'd'), listOf('b', 'c', 'e', 'f')) // Output: ['b', 'c']
 */
fun intersectionAndOperatorSlicingTuples(tuple1: List<Any>, tuple2: List<Any>): List<Any> {

    val commonElements = mutableListOf<Any>()

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

    return commonElements
}
/**
 * This exercise requires finding the intersection of two tuples using the logical AND operator and slicing tuples.
 *
 * Given two tuples, tuple1 and tuple2, the function should return a new tuple that contains only the elements present in both tuple1 and tuple2.
 *
 * @param tuple1 The first tuple.
 * @param tuple2 The second tuple.
 * @return A new tuple containing the common elements from tuple1 and tuple2.
 *
 * Example:
 * intersectionAndOperatorSlicingTuples(listOf('a', 'b', 'c', 'd'), listOf('b', 'c', 'e', 'f')) // Output: ['b', 'c']
 */
fun intersectionAndOperatorSlicingTuples(tuple1: List<Any>, tuple2: List<Any>): List<Any> {
/**
 * This exercise requires finding the intersection of two tuples using the logical AND operator and slicing tuples.
 *
 * Given two tuples, tuple1 and tuple2, the function should return a new tuple that contains only the elements present in both tuple1 and tuple2.
 *
 * @param tuple1 The first tuple.
 * @param tuple2 The second tuple.
 * @return A new tuple containing the common elements from tuple1 and tuple2.
 *
 * Example:
 * intersectionAndOperatorSlicingTuples(listOf('a', 'b', 'c', 'd'), listOf('b', 'c', 'e', 'f')) // Output: ['b', 'c']
 */
fun intersectionAndOperatorSlicingTuples(tuple1: List<Any>, tuple2: List<Any>): List<Any> {

    val commonElements = mutableListOf<Any>()

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

    return commonElements
}