Given an array of values, design and code an algorithm that returns whether there are two duplicates within k indices of each other? k indices and within plus or minus l (value) of each other? Do all, even the latter, in O(n) running time and O(k) space.
Anonymous
The first is trivial. The second involves partitioning the real numbers into multiples of k.
Check out your Company Bowl for anonymous work chats.