Is there a built-in function (or an easy implementation) for splitting a list into sublists based on the element value
For example, if the list is:
val