Paste: aoc4
Author: | Krenium |
Mode: | factor |
Date: | Wed, 4 Dec 2019 18:09:10 |
Plain Text |
USING: backtrack grouping kernel math math.functions math.order
math.parser math.ranges prettyprint sequences sequences.extras
sequences.generalizations splitting.monotonic ;
IN: aoc.2019.04a
: d ( m -- n n ) 9 [a,b] amb-lazy dup ;
[ 1 d d d d d d drop 6 narray ] bag-of
[ reverse [ 10^ * ] map-index sum ]
[ 273025 767253 between? ] map-filter
[ number>string ] map [ [ 2 clump [ first2 = ] any? ] count . ]
[ [ [ = ] monotonic-split [ length 2 = ] any? ] count . ] bi
New Annotation