0

I wrote the following function to convert List[Int] => List[List[Int]].
Its intended purpose is to extract 1, followed by its non 1 followers, into a group.
input: List(1,2,2,1,3,3)
output: List( List(1,2,2), List(1,3,3) )
Function
def leadingOnesGroup(xs: List[Int]): List[List[Int]] =
...