Approach hintTry it first, then revealHide
Scan from the right and keep a value only the first time you meet it, using a set of values already kept; reverse the kept list at the end to restore the original order.
Scan from the right and keep a value only the first time you meet it, using a set of values already kept; reverse the kept list at the end to restore the original order.