/**
 * The function takes two ranges and finds the common elements between them.
 * It returns a list containing the common elements found.
 *
 * @param range1 A range of values. (e.g., IntRange(1, 10))
 * @param range2 Another range of values. (e.g., IntRange(5, 15))
 * @return A list containing the common elements found between range1 and range2.
 */
fun findCommonElements(range1: IntRange, range2: IntRange): List<Int> {

    val commonElements = mutableListOf<Int>()
    for (i in range1) {
        for (j in range2) {
            if (i == j) {
                commonElements.add(i)
            }
        }
    }
    return commonElements
}

// Exercise
/**
 * The function takes two ranges and finds the common elements between them.
 * It returns a list containing the common elements found.
 *
 * @param range1 A range of values. (e.g., IntRange(1, 10))
 * @param range2 Another range of values. (e.g., IntRange(5, 15))
 * @return A list containing the common elements found between range1 and range2.
 */
fun findCommonElements(range1: IntRange, range2: IntRange): List<Int> {
/**
 * The function takes two ranges and finds the common elements between them.
 * It returns a list containing the common elements found.
 *
 * @param range1 A range of values. (e.g., IntRange(1, 10))
 * @param range2 Another range of values. (e.g., IntRange(5, 15))
 * @return A list containing the common elements found between range1 and range2.
 */
fun findCommonElements(range1: IntRange, range2: IntRange): List<Int> {

    val commonElements = mutableListOf<Int>()
    for (i in range1) {
        for (j in range2) {
            if (i == j) {
                commonElements.add(i)
            }
        }
    }
    return commonElements
}

// Exercise