/**
 * This function finds the common factors between two numbers by using the modulus operator and is operator.
 *
 * @param n1 The first number.
 * @param n2 The second number.
 * @return A list containing the common factors of the two numbers.
 */
fun findCommonFactors(n1: Int, n2: Int): List<Int> {

    val commonFactors = mutableListOf<Int>()

    for (i in 1..minOf(n1, n2)) {
        if (n1 % i == 0 && n2 % i == 0) {  // Check if i is a common factor of both numbers
            commonFactors.add(i)  // Add i to the list of common factors
        }
    }

    return commonFactors
}
/**
 * This function finds the common factors between two numbers by using the modulus operator and is operator.
 *
 * @param n1 The first number.
 * @param n2 The second number.
 * @return A list containing the common factors of the two numbers.
 */
fun findCommonFactors(n1: Int, n2: Int): List<Int> {
/**
 * This function finds the common factors between two numbers by using the modulus operator and is operator.
 *
 * @param n1 The first number.
 * @param n2 The second number.
 * @return A list containing the common factors of the two numbers.
 */
fun findCommonFactors(n1: Int, n2: Int): List<Int> {

    val commonFactors = mutableListOf<Int>()

    for (i in 1..minOf(n1, n2)) {
        if (n1 % i == 0 && n2 % i == 0) {  // Check if i is a common factor of both numbers
            commonFactors.add(i)  // Add i to the list of common factors
        }
    }

    return commonFactors
}