C - Centers Editorial
by
dbsic211
User Editorial
Use a map or frequency array to store the number of occurrences of each element so far.
Then, when we see the second occurrence of each element, simply output the element.
Time complexity: \(O(n)\) or \(O(n \log n)\). You can see my submission https://atcoder.jp/contests/abc306/submissions/42321736 but it is overcomplicated.
posted:
last update: