<@U3669PPNG> Yeah… id ended up with that. ``` fun ...
# announcements
j
@nkiesel Yeah… id ended up with that.
Copy code
fun getDivisors(n: Int): List<Int> {
    val limit = Math.sqrt(n.toDouble()).toInt()
    return (1..limit).filter { n % it == 0 }.flatMap {
        val squaredIsN = it * it == n
        if (squaredIsN) listOf(it) else listOf(it, n / it)
    }
}