amwmedia
12/8/2017 - 2:42 PM

Advent Of Code 2017 - Day 4

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;