Advent Of Code 2017 - Day 4
// input is array of passphrases
input.filter(
phrase => phrase
.split(' ')
.map(word => word.split('').sort().join(''))
.every((word, idx, arr) => arr.indexOf(word) === idx)
).length;
// input is array of passphrases
input.filter(
phrase => phrase
.split(' ')
.every((word, idx, arr) => arr.indexOf(word) === idx)
).length;