/**
 * Given two lists, find and return 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> {

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

    // Iterate over the elements of list1
    for (element1 in list1) {
        // Iterate over the elements of list2
        for (element2 in list2) {
            // Check if the current element in list1 is equal to the current element in list2
            if (element1 == element2) {
                // Add the common element to the list
                commonElements.add(element1)
                // Break the inner loop to avoid duplicates
                break
            }
        }
    }

    // Return the list of common elements
    return commonElements
}
/**
 * Given two lists, find and return 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> {
/**
 * Given two lists, find and return 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> {

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

    // Iterate over the elements of list1
    for (element1 in list1) {
        // Iterate over the elements of list2
        for (element2 in list2) {
            // Check if the current element in list1 is equal to the current element in list2
            if (element1 == element2) {
                // Add the common element to the list
                commonElements.add(element1)
                // Break the inner loop to avoid duplicates
                break
            }
        }
    }

    // Return the list of common elements
    return commonElements
}