/**
 * This function takes in two lists of elements and returns a new list containing the common elements between the two lists.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return A new list containing the common elements between list1 and list2.
 */
fun commonElements(list1: List<Any>, list2: List<Any>): List<Any> {

    val commonElementsList = mutableListOf<Any>()

    // Iterate over the elements in list1
    for (element in list1) {
        // Check if the element exists in list2
        if (element in list2) {
            // Add the common element to the commonElementsList
            commonElementsList.add(element)
        }
    }

    return commonElementsList
}
/**
 * This function takes in two lists of elements and returns a new list containing the common elements between the two lists.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return A new list containing the common elements between list1 and list2.
 */
fun commonElements(list1: List<Any>, list2: List<Any>): List<Any> {
/**
 * This function takes in two lists of elements and returns a new list containing the common elements between the two lists.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return A new list containing the common elements between list1 and list2.
 */
fun commonElements(list1: List<Any>, list2: List<Any>): List<Any> {

    val commonElementsList = mutableListOf<Any>()

    // Iterate over the elements in list1
    for (element in list1) {
        // Check if the element exists in list2
        if (element in list2) {
            // Add the common element to the commonElementsList
            commonElementsList.add(element)
        }
    }

    return commonElementsList
}