This question evaluates understanding of algorithm design and graph-like relation reasoning, focusing on query minimization, constant O(1) extra space techniques, and rigorous time/space complexity analysis.
You have n accounts labeled 0..n-1 and an oracle hasMessaged(a, b) that returns true if account a has sent at least one message to account b. Define a "spammer" as an account that has messaged every other account and has received messages from none. Find the spammer if one exists using O(n) oracle calls and O(