> reverse a list without mutation using a foldLeft
This is maybe a little too obvious if you understand left folding at all. A less trivial exercise in the same vein is to implement right folding via left folding. It's just a one-liner, but if you haven't tried it before, it's enlightening and worth giving a shot.
This is maybe a little too obvious if you understand left folding at all. A less trivial exercise in the same vein is to implement right folding via left folding. It's just a one-liner, but if you haven't tried it before, it's enlightening and worth giving a shot.