basic version
algo to admit specific duplicates in a list