/**
 * This exercise aims to test the ability of iterating over a dictionary and using the range function with lists.
 * The task is to find the intersection between the list of values and the keys in the given dictionary.
 * The function should return a list containing the common elements.
 *
 * @param dictionary A dictionary containing key-value pairs.
 * @param list_of_values A list of values.
 * @return intersection A list containing the common elements between the dictionary keys and the list values.
 */
fun intersectionOfRangeListAndDict(dictionary: Map<String, Any>, list_of_values: List<Any>): List<Any> {

    val intersection = mutableListOf<Any>()

    // Iterate over the indices of the list
    for (i in list_of_values.indices) {
        // Access the value at the current index in the list
        val value = list_of_values[i]

        // Check if the value exists in the dictionary as a key
        if (dictionary.containsKey(value)) {
            // Append the value to the intersection list
            intersection.add(value)
        }
    }

    return intersection
}
/**
 * This exercise aims to test the ability of iterating over a dictionary and using the range function with lists.
 * The task is to find the intersection between the list of values and the keys in the given dictionary.
 * The function should return a list containing the common elements.
 *
 * @param dictionary A dictionary containing key-value pairs.
 * @param list_of_values A list of values.
 * @return intersection A list containing the common elements between the dictionary keys and the list values.
 */
fun intersectionOfRangeListAndDict(dictionary: Map<String, Any>, list_of_values: List<Any>): List<Any> {
/**
 * This exercise aims to test the ability of iterating over a dictionary and using the range function with lists.
 * The task is to find the intersection between the list of values and the keys in the given dictionary.
 * The function should return a list containing the common elements.
 *
 * @param dictionary A dictionary containing key-value pairs.
 * @param list_of_values A list of values.
 * @return intersection A list containing the common elements between the dictionary keys and the list values.
 */
fun intersectionOfRangeListAndDict(dictionary: Map<String, Any>, list_of_values: List<Any>): List<Any> {

    val intersection = mutableListOf<Any>()

    // Iterate over the indices of the list
    for (i in list_of_values.indices) {
        // Access the value at the current index in the list
        val value = list_of_values[i]

        // Check if the value exists in the dictionary as a key
        if (dictionary.containsKey(value)) {
            // Append the value to the intersection list
            intersection.add(value)
        }
    }

    return intersection
}