/**
 * This function takes two lists as input and finds the common elements between them.
 * It uses a break statement to terminate the loop early when a match is found.
 * The function returns a new list containing the common elements.
 */
fun findCommonElements(list1: List<Int>, list2: List<Int>): List<Int> {

    val commonElements = mutableListOf<Int>()

    for (element1 in list1) {
        for (element2 in list2) {
            if (element1 == element2) {
                commonElements.add(element1)
                break
            }
            // Write an if statement to check if element1 is greater than element2.
            // If true, use the continue statement to skip to the next iteration of the inner loop.
            if (element1 > element2) {
                continue
            }
        }
    }

    return commonElements
}
/**
 * This function takes two lists as input and finds the common elements between them.
 * It uses a break statement to terminate the loop early when a match is found.
 * The function returns a new list containing the common elements.
 */
fun findCommonElements(list1: List<Int>, list2: List<Int>): List<Int> {
/**
 * This function takes two lists as input and finds the common elements between them.
 * It uses a break statement to terminate the loop early when a match is found.
 * The function returns a new list containing the common elements.
 */
fun findCommonElements(list1: List<Int>, list2: List<Int>): List<Int> {

    val commonElements = mutableListOf<Int>()

    for (element1 in list1) {
        for (element2 in list2) {
            if (element1 == element2) {
                commonElements.add(element1)
                break
            }
            // Write an if statement to check if element1 is greater than element2.
            // If true, use the continue statement to skip to the next iteration of the inner loop.
            if (element1 > element2) {
                continue
            }
        }
    }

    return commonElements
}