Last active
December 8, 2017 14:47
-
-
Save amwmedia/4320f4205b6844983261b005b61f143c to your computer and use it in GitHub Desktop.
Advent Of Code 2017 - Day 4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// input is array of passphrases | |
input.filter( | |
phrase => phrase | |
.split(' ') | |
.every((word, idx, arr) => arr.indexOf(word) === idx) | |
).length; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment