/**
 * This function finds the common numbers between a given range and a list of integers.
 *
 * @param range_start The starting value of the range.
 * @param range_end The ending value of the range.
 * @param num_list The list of integers.
 * @return A list containing the common numbers between the range and the list.
 *
 * Examples:
 * findCommonNumbers(1, 10, [5, 10, 15, 20]) -> [5, 10]
 * findCommonNumbers(10, 20, [5, 10, 15, 20]) -> [10, 15, 20]
 */
fun findCommonNumbers(range_start: Int, range_end: Int, num_list: List<Int>): List<Int> {

    val commonNumbers = mutableListOf<Int>()
    
    // Iterate through the given range
    for (num in range_start..range_end) {
        // Check if the current number is present in the list
        if (num in num_list) {
            commonNumbers.add(num)
        }
    }
    
    return commonNumbers
}
/**
 * This function finds the common numbers between a given range and a list of integers.
 *
 * @param range_start The starting value of the range.
 * @param range_end The ending value of the range.
 * @param num_list The list of integers.
 * @return A list containing the common numbers between the range and the list.
 *
 * Examples:
 * findCommonNumbers(1, 10, [5, 10, 15, 20]) -> [5, 10]
 * findCommonNumbers(10, 20, [5, 10, 15, 20]) -> [10, 15, 20]
 */
fun findCommonNumbers(range_start: Int, range_end: Int, num_list: List<Int>): List<Int> {
/**
 * This function finds the common numbers between a given range and a list of integers.
 *
 * @param range_start The starting value of the range.
 * @param range_end The ending value of the range.
 * @param num_list The list of integers.
 * @return A list containing the common numbers between the range and the list.
 *
 * Examples:
 * findCommonNumbers(1, 10, [5, 10, 15, 20]) -> [5, 10]
 * findCommonNumbers(10, 20, [5, 10, 15, 20]) -> [10, 15, 20]
 */
fun findCommonNumbers(range_start: Int, range_end: Int, num_list: List<Int>): List<Int> {

    val commonNumbers = mutableListOf<Int>()
    
    // Iterate through the given range
    for (num in range_start..range_end) {
        // Check if the current number is present in the list
        if (num in num_list) {
            commonNumbers.add(num)
        }
    }
    
    return commonNumbers
}