/**
 * Given two lists, find and return the common elements between them.
 *
 * @param list1 The first list (type: List)
 * @param list2 The second list (type: List)
 * @return A new list containing only the common elements (type: List)
 */
fun getCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {

    val commonElements = mutableListOf<Any>()

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

    return commonElements
}
/**
 * Given two lists, find and return the common elements between them.
 *
 * @param list1 The first list (type: List)
 * @param list2 The second list (type: List)
 * @return A new list containing only the common elements (type: List)
 */
fun getCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {
/**
 * Given two lists, find and return the common elements between them.
 *
 * @param list1 The first list (type: List)
 * @param list2 The second list (type: List)
 * @return A new list containing only the common elements (type: List)
 */
fun getCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {

    val commonElements = mutableListOf<Any>()

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

    return commonElements
}