I would start with a wrapper function that creates a hash table and passes a hash table and a list of the second function (alternatively, use the argument &optionalif you use Common Lisp).
Then the following pseudo-code should be sufficient:
If we're looking at an empty list, there are no duplicates
If the head is a list, we can return the logical OR of "inspect the head" and "inspect the tail"
If the head is an atom, it a duplicate if it already in the hash table. If not, add it to the hash table and inspect the tail for duplicates.
source
share