Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const packetOffset = 4
- const offset = input.split('')
- .findIndex((item, index, chars) => [...new Set(
- Array.from({ length: packetOffset }, (_, i) => chars[index + i])
- )].length === packetOffset) + packetOffset;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement