From 8777ff071f7bb37631baa7b6717ad29961e50911 Mon Sep 17 00:00:00 2001 From: "H.J" Date: Wed, 9 Oct 2024 11:36:55 -0400 Subject: sorting by language --- aoc2020/day-06/day-06.rkt | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 aoc2020/day-06/day-06.rkt (limited to 'aoc2020/day-06') diff --git a/aoc2020/day-06/day-06.rkt b/aoc2020/day-06/day-06.rkt deleted file mode 100644 index b0e2af9..0000000 --- a/aoc2020/day-06/day-06.rkt +++ /dev/null @@ -1,22 +0,0 @@ -#lang racket -(require "../../jj-aoc.rkt" - threading) - -(define responses (~> (open-day 6 2020) (port->string) (string-split "\n\n"))) - -;; part 1 -(define (response-count-total rs) - (for/sum ([r (in-list rs)]) (~> r (string-replace _ "\n" "") string->list list->set set-count))) - -(response-count-total responses) - -;; part 2 -(define (response-consensus-total rs) - (for/sum ([r (in-list rs)]) - (~> r - (string-split _ "\n") - (map (λ~> string->list list->set) _) - (apply set-intersect _) - set-count))) - -(response-consensus-total responses) \ No newline at end of file -- cgit v1.2.3