/**
 * This exercise tests your knowledge on accessing elements in a list using the 'in' operator.
 * You are required to implement a function that finds the common elements between two lists.
 *
 * @param list1 A list
 * @param list2 Another list
 * @return A list containing the common elements between list1 and list2.
 */
fun getCommonElementsFromLists(list1: List<Any>, list2: List<Any>): List<Any> {

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

    // Iterate over each element in list1
    for (element in list1) {
        // Check if the element is present in list2
        if (element in list2) {
            // Add the element to the commonElements list
            commonElements.add(element)
        }
    }

    return commonElements
}
/**
 * This exercise tests your knowledge on accessing elements in a list using the 'in' operator.
 * You are required to implement a function that finds the common elements between two lists.
 *
 * @param list1 A list
 * @param list2 Another list
 * @return A list containing the common elements between list1 and list2.
 */
fun getCommonElementsFromLists(list1: List<Any>, list2: List<Any>): List<Any> {
/**
 * This exercise tests your knowledge on accessing elements in a list using the 'in' operator.
 * You are required to implement a function that finds the common elements between two lists.
 *
 * @param list1 A list
 * @param list2 Another list
 * @return A list containing the common elements between list1 and list2.
 */
fun getCommonElementsFromLists(list1: List<Any>, list2: List<Any>): List<Any> {

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

    // Iterate over each element in list1
    for (element in list1) {
        // Check if the element is present in list2
        if (element in list2) {
            // Add the element to the commonElements list
            commonElements.add(element)
        }
    }

    return commonElements
}