Quant Memo
Coding/●●●●●

First ticker that trades exactly once

You receive the tape as an ordered list of traded symbols. Return the first symbol whose total count in the whole tape is exactly one. If every symbol repeats, return None.

tape = ["AAPL", "MSFT", "AAPL", "GOOG"]
-> "MSFT"       # AAPL repeats; MSFT is the first that never does

Return the first symbol with total frequency one, in tape order. Aim for O(n)O(n).

Your answer

This one is open-ended. Work it through, then check your reasoning against the full solution.

More Coding questions