Find the id that appears once among triples
A gateway now logs every order message three times (send, ack, echo), so each id should appear exactly three times. One id appears only once because two of its copies were dropped.
ids = [2, 2, 3, 2] # 2 appears three times, 3 appears once
-> 3
Find the lone id in time and space. Assume non-negative ids.
Show a hint
XOR cancels pairs, not triples: , so XOR-ing everything leaves the singleton tangled with the tripled ids. Think one bit column at a time instead.
Your answer
This one is open-ended. Work it through, then check your reasoning against the full solution.