/**
 * Given two ranges of integers, the function should return a list
 * containing all the common elements found in both ranges.
 *
 * @param range1 A range of integers (e.g. IntRange(1, 10))
 * @param range2 Another range of integers (e.g. IntRange(5, 15))
 * @return A list containing the common elements found in both ranges
 *
 * Example:
 * intersectionOfLoopsAndTuple(1..10, 5..15)
 * -> [5, 6, 7, 8, 9]
 */
fun intersectionOfLoopsAndTuple(range1: IntRange, range2: IntRange): List<Int> {

    val commonElements = mutableListOf<Int>()
    for (num1 in range1) {  // Loop through the first range
        for (num2 in range2) {  // Loop through the second range
            if (num1 == num2) {  // Check if the two numbers are equal
                commonElements.add(num1)  // Add the common element to the list
            }
        }
    }
    return commonElements
}
/**
 * Given two ranges of integers, the function should return a list
 * containing all the common elements found in both ranges.
 *
 * @param range1 A range of integers (e.g. IntRange(1, 10))
 * @param range2 Another range of integers (e.g. IntRange(5, 15))
 * @return A list containing the common elements found in both ranges
 *
 * Example:
 * intersectionOfLoopsAndTuple(1..10, 5..15)
 * -> [5, 6, 7, 8, 9]
 */
fun intersectionOfLoopsAndTuple(range1: IntRange, range2: IntRange): List<Int> {
/**
 * Given two ranges of integers, the function should return a list
 * containing all the common elements found in both ranges.
 *
 * @param range1 A range of integers (e.g. IntRange(1, 10))
 * @param range2 Another range of integers (e.g. IntRange(5, 15))
 * @return A list containing the common elements found in both ranges
 *
 * Example:
 * intersectionOfLoopsAndTuple(1..10, 5..15)
 * -> [5, 6, 7, 8, 9]
 */
fun intersectionOfLoopsAndTuple(range1: IntRange, range2: IntRange): List<Int> {

    val commonElements = mutableListOf<Int>()
    for (num1 in range1) {  // Loop through the first range
        for (num2 in range2) {  // Loop through the second range
            if (num1 == num2) {  // Check if the two numbers are equal
                commonElements.add(num1)  // Add the common element to the list
            }
        }
    }
    return commonElements
}