You are viewing a single comment's thread. Return to all comments →
In Scala, assuming we're not able to use filter, we could instead use the fact that flatMap will filter out values of None.
filter
flatMap
None
arr.flatMap(a => if (a < delim) Some(a) else None)
Seems like cookies are disabled on this browser, please enable them to open this website
Filter Array
You are viewing a single comment's thread. Return to all comments →
In Scala, assuming we're not able to use
filter
, we could instead use the fact thatflatMap
will filter out values ofNone
.