/**
 * This function takes two positive integers 'a' and 'b' and returns a list of their common factors.
 */
fun findCommonFactors(a: Int, b: Int): List<Int> {

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

    // Iterate from 1 to the smaller number between 'a' and 'b'
    for (i in 1..minOf(a, b)) {
        // Check if 'i' is a factor of both 'a' and 'b'
        if (a % i == 0 && b % i == 0) {
            // Append the common factor to the list
            commonFactors.add(i)
        }
    }

    // Return the list of common factors
    return commonFactors
}
/**
 * This function takes two positive integers 'a' and 'b' and returns a list of their common factors.
 */
fun findCommonFactors(a: Int, b: Int): List<Int> {
/**
 * This function takes two positive integers 'a' and 'b' and returns a list of their common factors.
 */
fun findCommonFactors(a: Int, b: Int): List<Int> {

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

    // Iterate from 1 to the smaller number between 'a' and 'b'
    for (i in 1..minOf(a, b)) {
        // Check if 'i' is a factor of both 'a' and 'b'
        if (a % i == 0 && b % i == 0) {
            // Append the common factor to the list
            commonFactors.add(i)
        }
    }

    // Return the list of common factors
    return commonFactors
}