/**
 * This function takes two lists as input and finds the common elements between them.
 * The function should break out of the loop if it encounters an element that is not present in both lists.
 *
 * @param list1 The first list
 * @param list2 The second list
 * @return A list containing the common elements between the two input lists
 */
fun findCommonElements(list1: List<Int>, list2: List<Int>): List<Int> {

    val commonElements = mutableListOf<Int>()
    for (i in list1.indices) {
        for (j in list2.indices) {
            if (list1[i] == list2[j]) {
                commonElements.add(list1[i])
                break  // Fill in the missing statement to break out of the inner loop
            }
        }
    }
    return commonElements
}
/**
 * This function takes two lists as input and finds the common elements between them.
 * The function should break out of the loop if it encounters an element that is not present in both lists.
 *
 * @param list1 The first list
 * @param list2 The second list
 * @return A list containing the common elements between the two input lists
 */
fun findCommonElements(list1: List<Int>, list2: List<Int>): List<Int> {
/**
 * This function takes two lists as input and finds the common elements between them.
 * The function should break out of the loop if it encounters an element that is not present in both lists.
 *
 * @param list1 The first list
 * @param list2 The second list
 * @return A list containing the common elements between the two input lists
 */
fun findCommonElements(list1: List<Int>, list2: List<Int>): List<Int> {

    val commonElements = mutableListOf<Int>()
    for (i in list1.indices) {
        for (j in list2.indices) {
            if (list1[i] == list2[j]) {
                commonElements.add(list1[i])
                break  // Fill in the missing statement to break out of the inner loop
            }
        }
    }
    return commonElements
}