Paste: AoC 2022 day 6

Author: xr
Mode: factor
Date: Tue, 6 Dec 2022 10:15:37
Plain Text |
! Copyright (C) 2022 Your name.
! See http://factorcode.org/license.txt for BSD license.
USING: aoc grouping sequences kernel sets math ;
IN: aoc2022-6

: part1 ( -- n )
  P" resource:work/aoc2022-6/input.txt" load-file first
  4 clump [ all-unique? ] find length + ;

: part2 ( -- n )
  P" resource:work/aoc2022-6/input.txt" load-file first
  14 clump [ all-unique? ] find length + ;

New Annotation

Summary:
Author:
Mode:
Body: