Challenge 3: flatMap — Solution fun main() { val orders = listOf( listOf("Apple", "Bread"), listOf("Milk"), listOf("Eggs", "Cheese", "Butter") ) val allItems = orders.flatMap { it } println(allItems) println("Total items ordered: ${allItems.size}") } /* Output: [Apple, Bread, Milk, Eggs, Cheese, Butter] Total items ordered: 6 Notes: - orders is a List> — three inner lists, one per customer. - flatMap { it } maps each inner list to itself, then flattens all three into a single List with six elements total. - Using plain map { it } instead would have kept the nesting, producing [[Apple, Bread], [Milk], [Eggs, Cheese, Butter]] — a list of three lists, not one flat list of six items. - .size on the flattened list gives the total item count across every order in a single call. */