We could think about using `unique` here to be lazy.  We'll still be memory bound though.