Skip to content

Instantly share code, notes, and snippets.

@Serchinastico
Created September 17, 2018 16:39
Show Gist options
  • Save Serchinastico/e929690c1081cc9947dd9d2bdf49f34a to your computer and use it in GitHub Desktop.
Save Serchinastico/e929690c1081cc9947dd9d2bdf49f34a to your computer and use it in GitHub Desktop.
groupby koan
// Return a map of the customers living in each city
fun Shop.groupCustomersByCity(): Map<City, List<Customer>> =
customers.groupBy { it.city }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment