I don't know enough Scala to say with certainty but that seems to be an error:
Seq(1,2,3,4) flatMap { x => Seq(x, -x) } == Seq(1,-2,2,-2,3,-3,4,-4)
I don't know enough Scala to say with certainty but that seems to be an error:
Seq(1,2,3,4) flatMap { x => Seq(x, -x) } == Seq(1,-2,2,-2,3,-3,4,-4)