DmitryTsyvtsyn/Kotlin-Algorithms-and-Design-Patterns

Factorial loop can be start from 2

RubberBigPepper opened this issue · 1 comments

fun compute(number: Int) : Int {
var result = 1
for (i in 1..number) { //loop can be i in 2..number as in FactorialBig
result *= i
}
return result
}

Good!)