DEV Community

Discussion on: De-duplicate arrays in Python, Perl and Ruby

Collapse
yukikimoto profile image
Yuki Kimoto

I use hash way in Perl because this is O(1) instead of O(n)

Collapse
matthewpersico profile image
Matthew O. Persico

How is this O(1)? You are going to go through every element in @dups at least once.

Collapse
yukikimoto profile image
Yuki Kimoto

Sorry. I misunderstood.