/**
 * Given two lists, find the common elements between them using the range function and the less than operator.
 *
 * @param list1 The first list
 * @param list2 The second list
 * @return A list of common elements between list1 and list2
 */
fun findCommonElements(list1: List<Int>, list2: List<Int>): List<Int> {

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

    // Loop through each element in list1
    for (i in list1.indices) {
        // Loop through each element in list2
        for (j in list2.indices) {
            // Check if the current element in list1 is equal to the current element in list2
            if (list1[i] == list2[j]) {
                // Check if the current element is not already in the commonElements list
                if (list1[i] !in commonElements) {
                    // Add the common element to the commonElements list
                    commonElements.add(list1[i])
                }
            }
        }
    }

    return commonElements
}
/**
 * Given two lists, find the common elements between them using the range function and the less than operator.
 *
 * @param list1 The first list
 * @param list2 The second list
 * @return A list of common elements between list1 and list2
 */
fun findCommonElements(list1: List<Int>, list2: List<Int>): List<Int> {
/**
 * Given two lists, find the common elements between them using the range function and the less than operator.
 *
 * @param list1 The first list
 * @param list2 The second list
 * @return A list of common elements between list1 and list2
 */
fun findCommonElements(list1: List<Int>, list2: List<Int>): List<Int> {

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

    // Loop through each element in list1
    for (i in list1.indices) {
        // Loop through each element in list2
        for (j in list2.indices) {
            // Check if the current element in list1 is equal to the current element in list2
            if (list1[i] == list2[j]) {
                // Check if the current element is not already in the commonElements list
                if (list1[i] !in commonElements) {
                    // Add the common element to the commonElements list
                    commonElements.add(list1[i])
                }
            }
        }
    }

    return commonElements
}