miszmaniac
03/14/2018, 7:40 PMfun getDivisors(n: Int) =
(1..Math.sqrt(n.toDouble()).toInt())
.filter { n % it == 0 }
.flatMap {
if (Math.pow(it.toDouble(), 2.0).toInt() != n) listOf(it, n / it) else listOf(it)
}