Algorithm · Google · Hard
You are given a sequence ids of integer identifiers. Work through three increasingly specialized forms of duplicate detection. For each form, describe the data structure, the invariant maintained after each step, and the expected asymptotic complexity. Clarifications: Two indices i and j are “within distance w” exactly when $$i \neq j$$ and $$ i - j \leq w$$. A window refers to the most recent elements considered under that distance rule. For Part 3, the same ids array stays…
Checking your access…