• + 3 comments

    Scala:

    arr.foldLeft(List[Int]())((acc,v) => v::acc)