This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to Collapse Nested Map into a Sequence of Flat Maps

 
Ari King
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How I can collapse a nested map with "n" number of keys (tiers) to create a sequence of flat maps which are comprised of composite keys and a values.

For example, let's say we have:



I'd like to collapse the nest into a sequence of flat maps like:

 
Ari King
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've put together a solution (see below) that collapses nested maps into a sequence of flat maps with composite keys. Unfortunately, the solution wraps the result within another list, anyone know why? Thanks.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic