/**
 * This function takes in two lists and finds the common elements between them using nested loops and the 'contains' method.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return A list of common elements present in both list1 and list2.
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {

    val commonElements = mutableListOf<Any>()
    for (element1 in list1) {
        for (element2 in list2) {
            if (element1 == element2 && element1 !in commonElements) {
                commonElements.add(element1)
            }
        }
    }
    return commonElements
}
/**
 * This function takes in two lists and finds the common elements between them using nested loops and the 'contains' method.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return A list of common elements present in both list1 and list2.
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {
/**
 * This function takes in two lists and finds the common elements between them using nested loops and the 'contains' method.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return A list of common elements present in both list1 and list2.
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {

    val commonElements = mutableListOf<Any>()
    for (element1 in list1) {
        for (element2 in list2) {
            if (element1 == element2 && element1 !in commonElements) {
                commonElements.add(element1)
            }
        }
    }
    return commonElements
}