/**
 * Given two integers 'a' and 'b', this function returns a map containing all the common factors of both numbers.
 */
fun getCommonFactors(a: Int, b: Int): Map<Int, Boolean> {

    if (a !is Int || b !is Int) {
        return mapOf(0 to false)
    }

    val commonFactors = mutableMapOf<Int, Boolean>()
    for (i in 1..maxOf(a, b)) {
        if (a % i == 0 && b % i == 0) {
            commonFactors[i] = true
        }
    }

    return commonFactors
}
/**
 * Given two integers 'a' and 'b', this function returns a map containing all the common factors of both numbers.
 */
fun getCommonFactors(a: Int, b: Int): Map<Int, Boolean> {
/**
 * Given two integers 'a' and 'b', this function returns a map containing all the common factors of both numbers.
 */
fun getCommonFactors(a: Int, b: Int): Map<Int, Boolean> {

    if (a !is Int || b !is Int) {
        return mapOf(0 to false)
    }

    val commonFactors = mutableMapOf<Int, Boolean>()
    for (i in 1..maxOf(a, b)) {
        if (a % i == 0 && b % i == 0) {
            commonFactors[i] = true
        }
    }

    return commonFactors
}