tracks/kotlin/exercises/perfect-numbers/.meta/src/reference/kotlin/NaturalNumber.kt in trackler-2.2.1.52 vs tracks/kotlin/exercises/perfect-numbers/.meta/src/reference/kotlin/NaturalNumber.kt in trackler-2.2.1.53
- old
+ new
@@ -2,10 +2,10 @@
enum class Classification {
DEFICIENT, PERFECT, ABUNDANT
}
fun classify(naturalNumber: Int): Classification {
- require(naturalNumber >= 0, { "$naturalNumber is not a natural number" })
+ require(naturalNumber > 0, { "$naturalNumber is not a natural number" })
val aliquotSum = naturalNumber.aliquotSum()
return when {
aliquotSum == naturalNumber -> Classification.PERFECT
aliquotSum > naturalNumber -> Classification.ABUNDANT