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