/**
 * This function checks for common elements between two lists and returns them.
 *
 * @param list1 First input list
 * @param list2 Second input list
 * @return List containing the common elements between list1 and list2
 */
fun checkForCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {

    val commonElements = mutableListOf<Any>()

    // Iterate over each element in list1
    for (element1 in list1) {
        // Iterate over each element in list2
        for (element2 in list2) {
            // Compare if element1 is equal to element2
            if (element1 == element2) {
                // Add the common element to the list
                commonElements.add(element1)
            }
        }
    }

    return commonElements
}
/**
 * This function checks for common elements between two lists and returns them.
 *
 * @param list1 First input list
 * @param list2 Second input list
 * @return List containing the common elements between list1 and list2
 */
fun checkForCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {
/**
 * This function checks for common elements between two lists and returns them.
 *
 * @param list1 First input list
 * @param list2 Second input list
 * @return List containing the common elements between list1 and list2
 */
fun checkForCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {

    val commonElements = mutableListOf<Any>()

    // Iterate over each element in list1
    for (element1 in list1) {
        // Iterate over each element in list2
        for (element2 in list2) {
            // Compare if element1 is equal to element2
            if (element1 == element2) {
                // Add the common element to the list
                commonElements.add(element1)
            }
        }
    }

    return commonElements
}