I’m struggling with an algorithmic problem how go transform or group data to get specified output. My input is a bunch of messages in given order (from newest to oldest): Desired output after transformation: So as you can see, each occurrence of the is_author parameter creates a new group that collects messages from this author ? Is there any efficient