/**
 * This function finds the common factors between two positive integers.
 *
 * @param a The first positive integer.
 * @param b The second positive integer.
 * @return A list containing the common factors between a and b.
 */
fun findCommonFactors(a: Int, b: Int): List<Int> {

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

    // Find the smaller number between a and b
    val smallerNum = minOf(a, b)

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

    return commonFactors
}
/**
 * This function finds the common factors between two positive integers.
 *
 * @param a The first positive integer.
 * @param b The second positive integer.
 * @return A list containing the common factors between a and b.
 */
fun findCommonFactors(a: Int, b: Int): List<Int> {
/**
 * This function finds the common factors between two positive integers.
 *
 * @param a The first positive integer.
 * @param b The second positive integer.
 * @return A list containing the common factors between a and b.
 */
fun findCommonFactors(a: Int, b: Int): List<Int> {

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

    // Find the smaller number between a and b
    val smallerNum = minOf(a, b)

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

    return commonFactors
}