Ad

Given a number n, it is your job to multiply the n by all the numbers that are below it stopping at 1.
So if n = 3 then the output should be 3 * 2 * 1 = 6

fun fact(n: Int): Int {
    var fact = 1
    var check = n
    while(check > 0) {
        fact *= check
        check--
    }
    return fact
}