Quant Memo
Coding/●●●●●

Longest shared prefix among tickers

Given a list of ticker symbols, find the longest prefix common to all of them. If they share nothing at the start, return the empty string.

tickers = ["INTC", "INTU", "INFY"]
-> "IN"

Return the longest common prefix of all tickers. Aim for O(N)O(N) total characters scanned.

Your answer

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

More Coding questions