Group consecutive equal elements. Example: [1,1,2,2,2,3,1,1] => [[1,1],[2,2,2],[3],[1,1]]
Implement this function:
def group_consecutive(lst: list) -> list:
Write the function only — the arguments are read for you and the return value is printed automatically.
Arguments arrive as one Python literal per line, in this order: lst.
Input
[1, 1, 2, 2, 2, 3, 1, 1]
Output
[[1, 1], [2, 2, 2], [3], [1, 1]]