/**
 * This function takes two lists as input and finds the common elements between them.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return A list containing the common elements between list1 and list2.
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {

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

    // Iterate through each element in list1
    for (element1 in list1) {
        // Iterate through each element in list2
        for (element2 in list2) {
            if (element1 == element2) {
                commonElements.add(element1)  // add common element to the list
            }
        }
    }

    return commonElements
}
/**
 * This function takes two lists as input and finds the common elements between them.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return A list containing the common elements between list1 and list2.
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {
/**
 * This function takes two lists as input and finds the common elements between them.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return A list containing the common elements between list1 and list2.
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {

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

    // Iterate through each element in list1
    for (element1 in list1) {
        // Iterate through each element in list2
        for (element2 in list2) {
            if (element1 == element2) {
                commonElements.add(element1)  // add common element to the list
            }
        }
    }

    return commonElements
}