# Paste: AOC day 1

Author: | chunes |

Mode: | factor |

Date: | Tue, 1 Dec 2020 11:53:52 |

Plain Text |

USING: fry io.encodings.ascii io.files kernel literals math
math.combinatorics math.parser prettyprint sequences ;
IN: aoc.2020.01
CONSTANT: input $[
"resource:work/aoc/2020/01/input.txt" ascii file-lines
[ string>number ] map
]
: find-product ( seq n target -- product )
'[ sum _ = ] find-combination product ;
: part1 ( -- ) input 2 2020 find-product . ;
: part2 ( -- ) input 3 2020 find-product . ;

Author: | chunes |

Mode: | factor |

Date: | Wed, 2 Dec 2020 14:00:54 |

Plain Text |

## New Annotation