/**
 * This exercise tests your knowledge of tuples and the AND operator.
 * Your task is to find the intersection of names and languages tuples using the AND operator.
 * Your solution should return a tuple containing only the elements that are present in both tuples, maintaining the order of occurrence in the names tuple.
 */
fun tupleIntersection(names: List<String>, languages: List<String>): List<String> {

    // Initialize an empty list to store the common elements
    val commonElements = mutableListOf<String>()

    // Iterate over each element in the names list
    for (name in names) {
        // Use the AND operator to check if the name is present in the languages list
        if (name in languages) {
            // Add the common element to the commonElements list
            commonElements.add(name)
        }
    }

    // Return the commonElements list
    return commonElements
}
/**
 * This exercise tests your knowledge of tuples and the AND operator.
 * Your task is to find the intersection of names and languages tuples using the AND operator.
 * Your solution should return a tuple containing only the elements that are present in both tuples, maintaining the order of occurrence in the names tuple.
 */
fun tupleIntersection(names: List<String>, languages: List<String>): List<String> {
/**
 * This exercise tests your knowledge of tuples and the AND operator.
 * Your task is to find the intersection of names and languages tuples using the AND operator.
 * Your solution should return a tuple containing only the elements that are present in both tuples, maintaining the order of occurrence in the names tuple.
 */
fun tupleIntersection(names: List<String>, languages: List<String>): List<String> {

    // Initialize an empty list to store the common elements
    val commonElements = mutableListOf<String>()

    // Iterate over each element in the names list
    for (name in names) {
        // Use the AND operator to check if the name is present in the languages list
        if (name in languages) {
            // Add the common element to the commonElements list
            commonElements.add(name)
        }
    }

    // Return the commonElements list
    return commonElements
}