Advertisement
degtyar

aoc 6 js

Dec 6th, 2022 (edited)
342
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const packetOffset = 4
  2. const offset = input.split('')
  3.   .findIndex((item, index, chars) => [...new Set(
  4.     Array.from({ length: packetOffset }, (_, i) => chars[index + i])
  5.   )].length === packetOffset) + packetOffset;
Tags: aoc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement