Jelly, 85 bytes
=TḢɗÐƤ¹ƇiÐƤ¹Ƈ
Returns values 1-indexed. Tack on a ’
for 0-indexed values. Port of my Vyxal answer.
ÐƤ Map over the suffixes...
---ɗ Collect three links as a dyad...
T i Indices where
= Find the first index Inputof equalsthe eachother value
Ḣ Find the first suchin indexeach
¹Ƈ Filter out zeroes