3 ms·
It was sloppy copying and pasting of a working expression. I think it's pretty clear I meant to write this: def contains_duplicate(array): return a
by crdoconnor 9y ago
It was sloppy copying and pasting of a working expression. I think it's pretty clear I meant to write this:
def contains_duplicate(array):
return any(len([y for y in array if x == y]) > 1 for x in array)
Or were you saying that this ^^ doesn't work?