diff --git a/src/ii_collections/n21Partition.kt b/src/ii_collections/n21Partition.kt index f95b0da35..e53e8b896 100644 --- a/src/ii_collections/n21Partition.kt +++ b/src/ii_collections/n21Partition.kt @@ -11,6 +11,9 @@ fun example8() { } fun Shop.getCustomersWithMoreUndeliveredOrdersThanDelivered(): Set { - // Return customers who have more undelivered orders than delivered - todoCollectionTask() + return customers.filter { + val (delivered, undelivered) = it.orders.partition { it.isDelivered } + + undelivered.size > delivered.size + }.toSet() }