divide a list in Kotlin by a rule
Let's say I have a list of strings which represent people and some properties about them in Kotlin.
I know the first element in the list will start with "PSN" prefix and the next list elements will be properties about that person.
After X lines I will see "PSN" prefix again and so I'll know this is a new person.
I want to group the list elements by the person they belong to.
Original list example:
val originalList : List =
["PSN Elvis Presley", "elvis property 1", "elvis property 2", "PSN...