Detect presence of duplicates in a list?

Jean-Francois Charles's icon

Hi,
It would be nice to have [zl thin] output a flag its right outlet when it indeed found duplicates.
For the moment, here is what I have to just answer the question "are there any duplicates in this list".
Any better way?

Max Patch
Copy patch and select New From Clipboard in Max.

Roman Thilenius's icon

if you only need to check IF there are doubles, you should start with zl union.

Jean-Francois Charles's icon

Thanks Roman. Actually, the patch works as it is: I just included a couple of lists at the top as test.
Rather, I'm asking if there are better ways to ask this question "IF there are doubles".

Source Audio's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Not better, but with less objects...

Christopher Dobrian's icon

FWIW, your way looks to me to be as good as any available in Max (unless you were to write your own object). -C

Jean-Francois Charles's icon
exeterdown's icon

I'd love this but if it gave you a list of which values were doubles.

Roman Thilenius's icon

i love that avatar. i needed 20 seconds. :)

Floating Point's icon

exeterdown:

Max Patch
Copy patch and select New From Clipboard in Max.

exeterdown's icon

Awesome, thanks!