Closed this issue 6 years ago · 1 comments
After a bit of playing around, I found this more "functional" version of containsDuplicate that takes advantage of array indicies!:
const containsDuplicate = nums => nums.some((num, i) => nums.indexOf(num) != i)
awesome!