Is there some kind of "scan until" operator in APL? Or a version of the power operator, but where each result is kept in a list and there's a separate state passed around each time?
Looks promising, I'm trying to play with the something to get the right bool vector to show up again next to the right ID numbers. But honestly it might be easier for me to go from the other side with the screenshot I've posted
(btw instead of images you could post paste (shameless self-advertisement); SE chat has a message length limit, but that can be worked around by using multiline messages, but then SE chat stops allowing markdown sooo)