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

    val commonElements = mutableListOf<Any>()

    // Iterate through each element in list1
    for (element in list1) {
        // Check if the element is present in list2
        if (element !in list2) {
            continue
        }

        // Iterate through each element in list2
        for (item in list2) {
            // Check if the item is equal to the element
            if (item == element) {
                // Check if the common element is already present in the commonElements list
                if (element !in commonElements) {
                    commonElements.add(element)
                    break
                }
            }
        }
    }

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

    val commonElements = mutableListOf<Any>()

    // Iterate through each element in list1
    for (element in list1) {
        // Check if the element is present in list2
        if (element !in list2) {
            continue
        }

        // Iterate through each element in list2
        for (item in list2) {
            // Check if the item is equal to the element
            if (item == element) {
                // Check if the common element is already present in the commonElements list
                if (element !in commonElements) {
                    commonElements.add(element)
                    break
                }
            }
        }
    }

    return commonElements
}