/**
 * Takes two lists as input and returns a list of common elements between the two lists.
 */
fun getCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {

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

    // Check if either of the lists is empty
    if (list1.isEmpty() || list2.isEmpty()) {
        return commonElements
    }

    // Loop through the elements in the first list
    for (element in list1) {
        // Check if the element is present in the second list
        if (list2.contains(element)) {
            // Check if the element is not already in the commonElements list
            if (element !in commonElements) {
                // Append the element to the commonElements list
                commonElements.add(element)
            }
        }
    }

    // Return the commonElements list
    return commonElements
}
/**
 * Takes two lists as input and returns a list of common elements between the two lists.
 */
fun getCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {
/**
 * Takes two lists as input and returns a list of common elements between the two lists.
 */
fun getCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {

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

    // Check if either of the lists is empty
    if (list1.isEmpty() || list2.isEmpty()) {
        return commonElements
    }

    // Loop through the elements in the first list
    for (element in list1) {
        // Check if the element is present in the second list
        if (list2.contains(element)) {
            // Check if the element is not already in the commonElements list
            if (element !in commonElements) {
                // Append the element to the commonElements list
                commonElements.add(element)
            }
        }
    }

    // Return the commonElements list
    return commonElements
}