/**
 * Write a function that finds the common factors between two positive integers.
 */
fun findCommonFactors(a: Int, b: Int): List<Int> {

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

    // Initialize a counter variable
    var i = 1

    // Use nested while loops to iterate through all possible factors of the first number
    while (i <= a) {
        // 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)
        }
        // Increment the counter
        i++
    }

    return commonFactors
}
/**
 * Write a function that finds the common factors between two positive integers.
 */
fun findCommonFactors(a: Int, b: Int): List<Int> {
/**
 * Write a function that finds the common factors between two positive integers.
 */
fun findCommonFactors(a: Int, b: Int): List<Int> {

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

    // Initialize a counter variable
    var i = 1

    // Use nested while loops to iterate through all possible factors of the first number
    while (i <= a) {
        // 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)
        }
        // Increment the counter
        i++
    }

    return commonFactors
}