private fun List.score(): Int { val quadrants = IntArray(4) val splitX = width / 2 val splitY = height / 2 mapNotNull { (p) -> when (p.x) { in 0 until splitX -> 0 splitX -> null else -> 2 }?.let { x -> when(p.y) { in 0 until splitY -> 0 splitY -> null else -> 1 }?.let { y -> quadrants[x + y]++ } } } return quadrants.reduce(Int::times) }