/**
 * This exercise aims to find the common factors between two integers using nested loops.
 *
 * @param n1 an integer representing the first number
 * @param n2 an integer representing the second number
 * @return a list of common factors between n1 and n2
 */
fun findCommonFactors(n1: Int, n2: Int): List<Int> {

    val commonFactors = mutableListOf<Int>()
    for (i in 1..Math.abs(n1)) {
        if (n1 % i == 0) {
            for (j in 1..Math.abs(n2)) {
                if (n2 % j == 0 && i == j) {
                    commonFactors.add(i)
                }
            }
        }
    }
    return commonFactors
}
/**
 * This exercise aims to find the common factors between two integers using nested loops.
 *
 * @param n1 an integer representing the first number
 * @param n2 an integer representing the second number
 * @return a list of common factors between n1 and n2
 */
fun findCommonFactors(n1: Int, n2: Int): List<Int> {
/**
 * This exercise aims to find the common factors between two integers using nested loops.
 *
 * @param n1 an integer representing the first number
 * @param n2 an integer representing the second number
 * @return a list of common factors between n1 and n2
 */
fun findCommonFactors(n1: Int, n2: Int): List<Int> {

    val commonFactors = mutableListOf<Int>()
    for (i in 1..Math.abs(n1)) {
        if (n1 % i == 0) {
            for (j in 1..Math.abs(n2)) {
                if (n2 % j == 0 && i == j) {
                    commonFactors.add(i)
                }
            }
        }
    }
    return commonFactors
}