Basic apply a function to elements of a list
Using map
No need for intermediary function
map square
Cleanup
filtering positive elements without filter
Using filter
filterNot
partition
takeWhile/dropWhile
span
pack exercise
Simplification
Simplification of initial code
encode
reduce operation on lists
Using reduceLeft
Syntactic sugar around anonymous function
Adding pdt
Using foldLeft which takes the initial value for the accumulator