Scala flatMap

I want to introduce you slowly to more complex problems. This one is still fun, as you know, the main topic isflatMapbut you are going to get an intuition for a little more.

Enjoy the ride.

Did you getflatMap? It ismapfollowed byflatten. Try to replace theflatMapin the code above bymapand addflattenafter it.

Ok, now that the topic of today's episode is done. What is the wizardry with all thecase?! This is calledpattern matching. I am sure that, right now, you have a good intuition about it, but we are going to dive more into it, soon.

Stay tuned!

Reveal more information and clues
Load Exercise