/**
 * Given two lists, return a new list containing the common elements found in both.
 *
 * @param list1 the first list
 * @param list2 the second list
 * @return A list containing the common elements found in both lists.
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {

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

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

    return commonElements
}
/**
 * Given two lists, return a new list containing the common elements found in both.
 *
 * @param list1 the first list
 * @param list2 the second list
 * @return A list containing the common elements found in both lists.
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {
/**
 * Given two lists, return a new list containing the common elements found in both.
 *
 * @param list1 the first list
 * @param list2 the second list
 * @return A list containing the common elements found in both lists.
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {

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

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

    return commonElements
}