/**
 * This exercise is designed for a Geologist to practice executing nested loops and performing operations on integers.
 *
 * The task is to find and return a list of common divisors between two given numbers.
 *
 * @param num1 The first number.
 * @param num2 The second number.
 * @return A list containing the common divisors between num1 and num2.
 */
fun findCommonDivisors(num1: Int, num2: Int): List<Int> {

    // Initialize an empty list to store common divisors
    val commonDivisors = mutableListOf<Int>()

    // Find the smaller number between num1 and num2
    val smallestNum = minOf(num1, num2)

    // Iterate through numbers from 1 to the smallest number
    for (i in 1..smallestNum) {
        // Check if both num1 and num2 are divisible by the current number
        if (num1 % i == 0 && num2 % i == 0) {
            // Append the current number to the commonDivisors list
            commonDivisors.add(i)
        }
    }

    return commonDivisors
}
/**
 * This exercise is designed for a Geologist to practice executing nested loops and performing operations on integers.
 *
 * The task is to find and return a list of common divisors between two given numbers.
 *
 * @param num1 The first number.
 * @param num2 The second number.
 * @return A list containing the common divisors between num1 and num2.
 */
fun findCommonDivisors(num1: Int, num2: Int): List<Int> {
/**
 * This exercise is designed for a Geologist to practice executing nested loops and performing operations on integers.
 *
 * The task is to find and return a list of common divisors between two given numbers.
 *
 * @param num1 The first number.
 * @param num2 The second number.
 * @return A list containing the common divisors between num1 and num2.
 */
fun findCommonDivisors(num1: Int, num2: Int): List<Int> {

    // Initialize an empty list to store common divisors
    val commonDivisors = mutableListOf<Int>()

    // Find the smaller number between num1 and num2
    val smallestNum = minOf(num1, num2)

    // Iterate through numbers from 1 to the smallest number
    for (i in 1..smallestNum) {
        // Check if both num1 and num2 are divisible by the current number
        if (num1 % i == 0 && num2 % i == 0) {
            // Append the current number to the commonDivisors list
            commonDivisors.add(i)
        }
    }

    return commonDivisors
}