/**
 * This exercise is designed to test your understanding of 'in' statement and loops.
 * You need to write a function that takes two lists as input and returns a list of common elements between them.
 *
 * @param list1 The first input list.
 * @param list2 The second input list.
 * @return A list of common elements found in both input lists.
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {

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

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

    // Return the list of common elements
    return commonElements
}
/**
 * This exercise is designed to test your understanding of 'in' statement and loops.
 * You need to write a function that takes two lists as input and returns a list of common elements between them.
 *
 * @param list1 The first input list.
 * @param list2 The second input list.
 * @return A list of common elements found in both input lists.
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {
/**
 * This exercise is designed to test your understanding of 'in' statement and loops.
 * You need to write a function that takes two lists as input and returns a list of common elements between them.
 *
 * @param list1 The first input list.
 * @param list2 The second input list.
 * @return A list of common elements found in both input lists.
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {

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

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

    // Return the list of common elements
    return commonElements
}