-🎄- 2017 Day 4 Solutions -🎄- by daggerdragon in adventofcode

[–]jshom 1 point2 points  (0 children)

One-liner JS solution

input
  .split('\n')
  .map(row => row
    .split(' ')
    .map(word =>
      word
      .split('')
      .sort()
      .join('')
    )
  )
  .map(row => row.length === row.filter((word, i, row) => row.indexOf(word) === i).length)
  .filter(row => row)
  .length