/**
 * Returns the common factors that divide both the dividend and divisor evenly.
 *
 * @param dividend The dividend value.
 * @param divisor The divisor value.
 * @return A list of common factors.
 */
fun findCommonFactors(dividend: Int, divisor: Int): List<Int> {

    // Find the minimum value between the dividend and divisor
    val minimumValue = minOf(dividend, divisor)

    // Define an empty list to store the common factors
    val commonFactors = mutableListOf<Int>()

    // Loop through all numbers starting from 1 up to the minimum value
    for (i in 1..minimumValue) {
        // Check if the current number is a factor of both the dividend and divisor
        if (dividend % i == 0 && divisor % i == 0) {
            // If it is, add it to the commonFactors list
            commonFactors.add(i)
        }
    }

    return commonFactors
}
/**
 * Returns the common factors that divide both the dividend and divisor evenly.
 *
 * @param dividend The dividend value.
 * @param divisor The divisor value.
 * @return A list of common factors.
 */
fun findCommonFactors(dividend: Int, divisor: Int): List<Int> {
/**
 * Returns the common factors that divide both the dividend and divisor evenly.
 *
 * @param dividend The dividend value.
 * @param divisor The divisor value.
 * @return A list of common factors.
 */
fun findCommonFactors(dividend: Int, divisor: Int): List<Int> {

    // Find the minimum value between the dividend and divisor
    val minimumValue = minOf(dividend, divisor)

    // Define an empty list to store the common factors
    val commonFactors = mutableListOf<Int>()

    // Loop through all numbers starting from 1 up to the minimum value
    for (i in 1..minimumValue) {
        // Check if the current number is a factor of both the dividend and divisor
        if (dividend % i == 0 && divisor % i == 0) {
            // If it is, add it to the commonFactors list
            commonFactors.add(i)
        }
    }

    return commonFactors
}