For all the supposed wonders that modern data science environments (e.g., r) allegedly bring, they are still clunky.
Awaiting the day when more natural language environments allow one to simply write “find the next object that is different than all the previous ones” and it works without worrying about looping or vectors.