To better understand flatten() and flatMap() functions, implement flatMap() using flatten().
flatten()
flatMap()