/**
 * Given two lists, find the common elements using a loop and the OR operator.
 *
 * @param list1 The first list (contains integers)
 * @param list2 The second list (contains integers)
 * @return A list containing the common elements found in list1 and list2
 */
fun checkCommonElements(list1: List<Int>, list2: List<Int>): List<Int> {

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

    for (element1 in list1) {  // Iterate over each element in list1
        for (element2 in list2) {  // Iterate over each element in list2
            if (element1 == element2) {
                // If the current elements are equal, add it to the commonElements list and break the loop
                commonElements.add(element1)
                break
            }
        }
    }

    return commonElements
}
/**
 * Given two lists, find the common elements using a loop and the OR operator.
 *
 * @param list1 The first list (contains integers)
 * @param list2 The second list (contains integers)
 * @return A list containing the common elements found in list1 and list2
 */
fun checkCommonElements(list1: List<Int>, list2: List<Int>): List<Int> {
/**
 * Given two lists, find the common elements using a loop and the OR operator.
 *
 * @param list1 The first list (contains integers)
 * @param list2 The second list (contains integers)
 * @return A list containing the common elements found in list1 and list2
 */
fun checkCommonElements(list1: List<Int>, list2: List<Int>): List<Int> {

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

    for (element1 in list1) {  // Iterate over each element in list1
        for (element2 in list2) {  // Iterate over each element in list2
            if (element1 == element2) {
                // If the current elements are equal, add it to the commonElements list and break the loop
                commonElements.add(element1)
                break
            }
        }
    }

    return commonElements
}