/**
 * This function takes a tuple and a dictionary as input and returns a list of elements 
 * that are common to both the tuple and the dictionary values.
 *
 * @param myTuple A tuple containing elements of any data type.
 * @param myDict A dictionary with values of any data type.
 * @return A list containing the common elements between the tuple and the dictionary values.
 *
 * Example:
 * tupleDictIntersection(listOf("apple", true, 5), mapOf("fruit" to "apple", "is_fruit" to true, "amount" to 5))
 */
fun tupleDictIntersection(myTuple: List<Any>, myDict: Map<String, Any>): List<Any> {

    val commonElements = mutableListOf<Any>()

    // Iterate over the tuple
    for (element in myTuple) {
        // Check if the element is present as a value in the dictionary
        if (element in myDict.values) {
            commonElements.add(element)
        }
    }

    return commonElements
}
/**
 * This function takes a tuple and a dictionary as input and returns a list of elements 
 * that are common to both the tuple and the dictionary values.
 *
 * @param myTuple A tuple containing elements of any data type.
 * @param myDict A dictionary with values of any data type.
 * @return A list containing the common elements between the tuple and the dictionary values.
 *
 * Example:
 * tupleDictIntersection(listOf("apple", true, 5), mapOf("fruit" to "apple", "is_fruit" to true, "amount" to 5))
 */
fun tupleDictIntersection(myTuple: List<Any>, myDict: Map<String, Any>): List<Any> {
/**
 * This function takes a tuple and a dictionary as input and returns a list of elements 
 * that are common to both the tuple and the dictionary values.
 *
 * @param myTuple A tuple containing elements of any data type.
 * @param myDict A dictionary with values of any data type.
 * @return A list containing the common elements between the tuple and the dictionary values.
 *
 * Example:
 * tupleDictIntersection(listOf("apple", true, 5), mapOf("fruit" to "apple", "is_fruit" to true, "amount" to 5))
 */
fun tupleDictIntersection(myTuple: List<Any>, myDict: Map<String, Any>): List<Any> {

    val commonElements = mutableListOf<Any>()

    // Iterate over the tuple
    for (element in myTuple) {
        // Check if the element is present as a value in the dictionary
        if (element in myDict.values) {
            commonElements.add(element)
        }
    }

    return commonElements
}