August 27, 2024
P07 - Flatten a nested list structure.
Example:
scala
scala> flatten(List(List(1, 1), 2, List(3, List(5, 8))))
res0: List[Any] = List(1, 1, 2, 3, 5, 8)
August 27, 2024
Example:
scala
scala> flatten(List(List(1, 1), 2, List(3, List(5, 8))))
res0: List[Any] = List(1, 1, 2, 3, 5, 8)
Don't have an account? We will create one for you.
Enter the OTP send to
in seconds.