Paste: AoC 2022 Day 6

Author: Kacarott
Mode: factor
Date: Tue, 6 Dec 2022 06:35:46
Plain Text |
! Copyright (C) 2022 Keldan Chapman.
! See http://factorcode.org/license.txt for BSD license.
USING: kernel AOC prettyprint sequences grouping sets math ;
IN: AOC.2022.6

: find-clump ( input n -- result )
    [ clump [ all-unique? ] find drop ] keep + ;

: part-1 ( input -- result ) 4 find-clump ;
: part-2 ( input -- result ) 14 find-clump ;

MAIN: [ 6 read-day-input [ part-1 . ] [ part-2 . ] bi ]

New Annotation

Summary:
Author:
Mode:
Body: