99 Elm Problems/Problem 9

Pack consecutive duplicates of list elements into sublists. If a list contains repeated elements they should be placed in separate sublists. Elements that are not repeated should be placed in a one element sublist.

Result:

Solutions