/**
 * This exercise requires you to find the common elements between two lists. However, you should use nested loops,
 * break statement, and continue statement to solve it.
 *
 * @param list1 The first list of elements
 * @param list2 The second list of elements
 * @return A list of common elements between list1 and list2
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {

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

    // Iterate over each element in list1
    for (elem1 in list1) {
        // Iterate over each element in list2
        for (elem2 in list2) {
            // Check if the current elements are equal
            if (elem1 == elem2) {
                // Add the common element to the commonElements list
                commonElements.add(elem1)
                // Break out of the inner loop
                break
            }
        }
        // Continue to the next element in list1
        continue
    }

    return commonElements
}
/**
 * This exercise requires you to find the common elements between two lists. However, you should use nested loops,
 * break statement, and continue statement to solve it.
 *
 * @param list1 The first list of elements
 * @param list2 The second list of elements
 * @return A list of common elements between list1 and list2
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {
/**
 * This exercise requires you to find the common elements between two lists. However, you should use nested loops,
 * break statement, and continue statement to solve it.
 *
 * @param list1 The first list of elements
 * @param list2 The second list of elements
 * @return A list of common elements between list1 and list2
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {

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

    // Iterate over each element in list1
    for (elem1 in list1) {
        // Iterate over each element in list2
        for (elem2 in list2) {
            // Check if the current elements are equal
            if (elem1 == elem2) {
                // Add the common element to the commonElements list
                commonElements.add(elem1)
                // Break out of the inner loop
                break
            }
        }
        // Continue to the next element in list1
        continue
    }

    return commonElements
}