adventofcode

Happy Advent 2020! Please put answers in the pinned threads or create one if it does not exist yet. | https://github.com/adventofcode-clojurians/adventofcode-clojurians | Join the private leaderboard with code 217019-4a55b8eb
theeternalpulse 2017-12-04T00:42:12.000090Z

I'll check it out, I think this was posted on a thread in reddit I had made.

2017-12-04T04:57:54.000033Z

Hallo fellow adventers

fellshard 2017-12-04T05:08:34.000061Z

o/

2017-12-04T05:22:07.000151Z

well, day3 upped the ante a little i see

dpsutton 2017-12-04T06:04:24.000170Z

yeah this is a tricky one

dpsutton 2017-12-04T06:37:35.000015Z

my inputs agree with their outputs for the first 23 values but i'm not getting the right answer for part b

fellshard 2017-12-04T06:53:36.000153Z

Misread the value they're looking for?

dpsutton 2017-12-04T07:01:50.000118Z

turns out what i thought was a special case for one number was in fact general

dpsutton 2017-12-04T07:02:12.000061Z

i was thinking in terms of rings of the spiral. so i ask which cells are adjacent in the inner ring and then which are adjacent in the same ring

fellshard 2017-12-04T07:22:46.000237Z

Ahh

fellshard 2017-12-04T07:23:12.000175Z

I went for a generic 3x3 scan so I didn't have to worry about details of which cells would or wouldn't be filled

dpsutton 2017-12-04T07:29:29.000258Z

yeah. i compute mine on the fly. and looking at the walk and create method, it looks better

dpsutton 2017-12-04T07:29:45.000239Z

and the code i saw uses the coordinates to know when to turn,, etc. it looks nice

dpsutton 2017-12-04T07:29:58.000151Z

i've never seen the with-tests macro either. that's pretty nice

dpsutton 2017-12-04T07:30:18.000183Z

but i do like the way mine came together

dpsutton 2017-12-04T07:30:21.000105Z

(defn cell-value [n]
  (if (= n 1)
    1
    (let [inner (inner-touching n)
          outer (outer-touching n)
          touching (distinct (concat inner outer))]
      ;; so a cell's value is the sum of the values it is touching,
      ;; either in its own ring or in the inner ring
      (apply + (map cell-value touching)))))

dpsutton 2017-12-04T07:30:57.000108Z

but lots of edge cases in the outer touching functoin

dpsutton 2017-12-04T07:31:08.000174Z

can you link me your day3.clj?

dpsutton 2017-12-04T07:32:26.000117Z

and then wrap that in a memoize and map it over a range and drop while lest than what they are looking for

2017-12-04T08:46:32.000229Z

totally brute forced day3

2017-12-04T08:56:43.000036Z

https://github.com/minikomi/advent-of-code/blob/master/src/advent/2017/day3.clj#L9-L14 Once I blagged that out on the repl / with pen & paper, I got it.. but not a solution I'm happy with

val_waeselynck 2017-12-04T09:08:20.000136Z

day 4: almost a no-brainer 🙂

borkdude 2017-12-04T09:13:30.000521Z

@val_waeselynck Very nice solution

😊 1
2017-12-04T09:20:19.000234Z

yeah, day4 was a piece of cake 😄

fellshard 2017-12-04T09:29:10.000601Z

Yeh. Hurrah for quick set conversion

borkdude 2017-12-04T09:29:33.000270Z

@fellshard Link to your solution?

fellshard 2017-12-04T09:30:16.000026Z

I dumped the entire input in, heh. 😫

2017-12-04T09:30:19.000180Z

hahaha

borkdude 2017-12-04T09:30:36.000264Z

cool 🙂

2017-12-04T09:30:58.000076Z

https://github.com/minikomi/advent-of-code/blob/master/src/advent/2017/day4.clj I just used distinct & sort

borkdude 2017-12-04T09:31:08.000181Z

I had this too at first #(= (count %) (count (set %)) == (apply distinct? ...)

fellshard 2017-12-04T09:31:25.000270Z

I haven't used distinct much, that's one to add to the toolkit!

borkdude 2017-12-04T09:31:30.000479Z

Yeah, I’ve seen sort a couple of times now. I feel so dumb

fellshard 2017-12-04T09:32:14.000341Z

First thing to think when looking for anagrams is a lex-sort : )

fellshard 2017-12-04T09:32:38.000118Z

Not when making them, so much

borkdude 2017-12-04T09:33:16.000009Z

Yeah, checking whether they exist vs. creating them

val_waeselynck 2017-12-04T10:04:59.000339Z

I'd like to practice core.logic, anyone knows a problem from AoC 2016 or 2015 for which it's a nice fit?

borkdude 2017-12-04T10:05:58.000043Z

@val_waeselynck hmm, I think this problem should be solvable with core.logic: https://blog.michielborkent.nl/blog/2017/10/10/parsing-a-circuit-with-clojure-spec/

val_waeselynck 2017-12-04T10:08:25.000159Z

@borkdude yeah so mostly a graph computation. Clara-rules or plumatic/graph could be a nice fit for that too.

orestis 2017-12-04T11:10:54.000253Z

The variability of answers for the “simple” puzzles is really an indicator of the language used, I’d think. I also used distinct and sort 🙂 https://github.com/orestis/adventofcode/blob/master/clojure/aoc/src/aoc/2017_day4.clj

2017-12-04T11:20:32.000469Z

ooh, thought of a better way to do day3-part1

borkdude 2017-12-04T11:33:50.000098Z

Is there a better way of counting with transducers? https://github.com/borkdude/aoc2017/blob/master/src/day4.clj#L58

erwin 2017-12-04T11:55:27.000113Z

maybe use (into [] ,,,) with count instead of transduce with highlighted line?

borkdude 2017-12-04T11:56:32.000129Z

yeah, or (count (sequence xform input))

borkdude 2017-12-04T11:58:07.000090Z

so:

(count
   (sequence (map identity)
             [1 2 3]))
  ;; vs
  (transduce (map (constantly 1))
             +
             [1 2 3])

2017-12-04T12:27:28.000024Z

Another idea:

(def xf (comp (filter odd?) (map inc)))
(transduce xf #(inc %) 0 (range 5))

borkdude 2017-12-04T12:42:00.000082Z

doesn’t compile

borkdude 2017-12-04T12:42:42.000032Z

day 4: I first checked for palindromes, but then realized they were not anagrams and then refactored… and eventually ended up with an inefficient solution 😳

borkdude 2017-12-04T12:57:16.000239Z

This one is nice. He just does it in the browser while having his input open: https://www.reddit.com/r/adventofcode/comments/7hf5xb/2017_day_4_solutions/dqqjrq2/

2017-12-04T13:25:34.000177Z

@borkdude for counts with transducers use net.cgrand.xforms/count to replace the (map (constantly 1))

borkdude 2017-12-04T13:33:49.000515Z

@thegeez something like this?

(first (eduction x/count
              [1 2 3]))

borkdude 2017-12-04T13:34:03.000297Z

(not yet familiar with this lib)

borkdude 2017-12-04T13:35:13.000050Z

o no, this is better: (x/count (map identity) [1 2 3])

dpsutton 2017-12-04T14:01:07.000481Z

@mfikes can you explain your invariant in your step function for day 3? In looking for the next location, you tag the locations as visited or not. And you find the first one unvisited after one that is visited in the list of potential squares left, down, right, up. Can you tell me why this works?

mfikes 2017-12-04T14:28:07.000183Z

@dpsutton I unfortunately don’t have anything close to a proof of why that approach works. It intuitively matches what I would do if I were trying to “spiral counter-clockwise,” without knowing which “linear direction” I’m already moving: I would try to choose the “counter-clockwise-most” free location. Perhaps a proof by contradiction could be constructed where if you chose any other location, you wouldn’t trace a spiral, but I don’t know if that reasoning is too sketchy. In short, it is a physical intuition that matches the concept of keeping your left hand on the wall and just tracing your path.

dpsutton 2017-12-04T14:30:43.000716Z

sounds good to me. that was very clever. I'm enjoying reading the code. People that are doing the spiral are having to enumerate how to make decisions. The one I've seen used the coordinates and the fact that it is a square to know when to turn. Yours didn't need this big decision tree and is quite clever

mfikes 2017-12-04T14:33:14.000151Z

It would be very interesting to categorize the kinds of solution “trees” that people have. I imagine they involve recognizing and using perfect squares, keeping track of a current linear direction and knowing when to turn (by memory, or by counting, or by being at a place where x=y or x=-y), or left-hand on wall. Maybe those are the 3?

2017-12-04T14:34:48.000494Z

For me it was -- did we change layers? go :up (went over another odd square), is it a "corner"? turn left.. (worked out a formula on the repl to generate a set of corners for current layer) otherwise, continue on in the current direction

mfikes 2017-12-04T14:36:23.000010Z

Yeah, I suspect a broad class of the solutions have a “state” in #{:up :left :down :right} that gets flipped at a corner, and then differences on how you detect a corner.

mfikes 2017-12-04T14:38:23.000737Z

FWIW, I think my solution is wasteful of memory, but I got lucky that the problem fit in RAM. 🙂

dpsutton 2017-12-04T14:38:55.000333Z

also your potential candidates function is written really well

dpsutton 2017-12-04T14:39:12.000475Z

(defn adjacent-locations
  "Given a location, produces the eight adjacent locations."
  [[x y]]
  (map (fn [[dx dy]]
         [(+ x dx) (+ y dy)])
    [[-1  1] [ 0  1] [ 1  1]
     [-1  0]         [ 1  0]
     [-1 -1] [ 0 -1] [ 1 -1]]))

dpsutton 2017-12-04T14:39:36.000189Z

ahh the formatting messed up but the grid layout and the hole for current location is super nice

mfikes 2017-12-04T14:39:56.000021Z

That second category doesn’t require O(n^2) memory, I’d guess

borkdude 2017-12-04T14:41:07.000271Z

@mfikes It felt a bit like cheating in the second part to keep a map around with all the previous “tiles” (as I called them), because that required more memory than needed maybe

dpsutton 2017-12-04T14:41:19.000004Z

my solution feels wasteful in trying to determine which cells in the current ring and inner ring are necessary for computation

dpsutton 2017-12-04T14:41:35.000255Z

and involved bringing edge cases rather than just a notion of "add 'em if you got 'em"

mfikes 2017-12-04T14:44:56.000275Z

@dpsutton Yes, I like using a “graphical” code solution sometimes. Here is another, where you need to parse digits from a file containing their representations. I chose to solve it by putting their representations in the code and then constructing a reverse mapping from those representations to the digits.

(def rendered-digit-lines
  "A sequence of 3 lines representing all of the digits in order."
  [" _     _  _     _  _  _  _  _ "
   "| |  | _| _||_||_ |_   ||_||_|"
   "|_|  ||_  _|  | _||_|  ||_| _| "])

(defn- lines->digit-representations
  "Converts a sequence of 3 lines into a sequence of representations
  of the digits on those lines, where each digit representation is
  a sequence of character triplets."
  [lines]
  (apply map list (map #(partition 3 %) lines)))

(def digit-representation->digit
  "A map from digit representation to digit."
  (zipmap (lines->digit-representations rendered-digit-lines)
          (range 10)))
If you look at digit-representation->digit, you’ll see what I mean.

borkdude 2017-12-04T14:46:18.000513Z

Ah, now I see it in your solution @mfikes, nicely done 🙂

mfikes 2017-12-04T14:46:41.000596Z

With the “hole” in the matrix, I had to be careful not to let my editor reformat the code 🙂

dpsutton 2017-12-04T14:47:03.000047Z

(def numerals-text (str " _     _  _     _  _  _  _  _ \n"
                        "| |  | _| _||_||_ |_   ||_||_|\n"
                        "|_|  ||_  _|  | _||_|  ||_| _|\n"))

(def numeral-streams (->> numerals-text
                          str/split-lines
                          (remove str/blank?)))

(defn chunk3
  "Partition a string into 3 character substrings"
  [s]
(map #(apply str %) (partition 3 s)))

borkdude 2017-12-04T14:47:03.000294Z

spaces in between are not usually formatted right?

dpsutton 2017-12-04T14:47:16.000262Z

i did the same thing

borkdude 2017-12-04T14:47:22.000281Z

Is the digits example from last year?

mfikes 2017-12-04T14:47:25.000109Z

Cursive will ignore the spaces and just mess it all up 🙂

dpsutton 2017-12-04T14:47:34.000333Z

it's a kata about ocr

mfikes 2017-12-04T14:47:44.000351Z

No the digits example is from a pre-screen interview I did

dpsutton 2017-12-04T14:47:50.000219Z

ha same

mfikes 2017-12-04T14:48:04.000062Z

Damn. You are right! 🙂

dpsutton 2017-12-04T14:48:14.000195Z

did you get the gig?

mfikes 2017-12-04T14:48:30.000255Z

Yes, but I didn’t take it

mfikes 2017-12-04T14:49:27.000389Z

Wow, the whole Kata looks the same. OK: User Story 1: I created a new project using lein new bank-ocr and this is the core file: https://gist.github.com/mfikes/f43d382057efa017ebfb User Story 2: I created a bank-ocr2, and took the contents of the previous story and simply added a account-number-value? method to compute the validity of a bank account: https://gist.github.com/mfikes/17ec1cfcdddfdba2b2f4 User Story 3: I created a bank-ocr3, took the stuff from User Story 2 and added a account-number-illegible? and revised the account number printing logic to print “?” characters and the additional “ILL” and “ERR” descriptors https://gist.github.com/mfikes/3c714859cb3da9384d52

dpsutton 2017-12-04T14:50:12.000245Z

yup. was it a health care company you interviewed with?

mfikes 2017-12-04T14:50:19.000793Z

No, it was Outpace

dpsutton 2017-12-04T14:50:33.000710Z

ah. i had the same thing with healthfinch

mfikes 2017-12-04T14:51:31.000133Z

FWIW, Outpace is/was awesome. The issue was mine: I backed out because I didn’t want to jump into full-time pairing without having done any, and not knowing what it was like to actually do it full time.

2017-12-04T14:52:55.000459Z

I think the 2d syntax from racket takes that kind of thing to the extreme https://docs.racket-lang.org/2d/index.html

2017-12-04T14:53:24.000417Z

ascii art as syntax

dpsutton 2017-12-04T15:11:21.000592Z

healthfinch seemed cool as well. they did the full time pair thing as well. which i think i would like if i were working remotely for the comraderie

mfikes 2017-12-04T15:37:53.000520Z

My Day 4 solutions are up. Wondering if anyone found anything simpler. I debated the aspect of counting the number of times a predicate matches a sequence, but in the end went with the obvious one. Perhaps there will be more interesting variation on how people detect valid passphrases. https://github.com/mfikes/advent-of-cljs/commit/4bff774da3e9760e10fbb6cb1e33d7614a185634

borkdude 2017-12-04T15:40:10.000334Z

@mfikes I think that’s as simple/efficient as it gets. It would be even simpler if you would put the two parts in one namespace, because a lot of the logic is re-usable (matter of taste)

mfikes 2017-12-04T15:40:47.000399Z

Yeah, that’s a recurring pattern with the part 1 / part 2 aspect.

borkdude 2017-12-04T15:41:29.000376Z

Notice that this one is almost the same as part 1, except for this line: https://github.com/borkdude/aoc2017/blob/master/src/day4.clj#L58

mfikes 2017-12-04T15:41:34.000336Z

I might take tha approach of putting common bits in a shared core ns.

mfikes 2017-12-04T15:42:03.000587Z

Yes, for me the addition of sort was the difference.

mfikes 2017-12-04T15:44:30.000167Z

I think that for this one, if you happen to remember that there is a core predicate that you can use, the problem is trivial. (Especially compared to Day 3.)

mfikes 2017-12-04T15:52:40.000745Z

Ahh nice—tentamen’s use of frequencies instead of sort might be faster if the words are long. :thinking_face:

borkdude 2017-12-04T15:54:42.000268Z

@mfikes With my puzzle input it turned out to be the same (sloppy benchmark of course): https://github.com/borkdude/aoc2017/blob/master/src/day4.clj#L77

mfikes 2017-12-04T15:58:28.000575Z

Yeah, if s contains the entire contents of /usr/share/dict/words, in self-hosted ClojureScript:

cljs.user=> (time (do (sort s) nil))
"Elapsed time: 4993.764097 msecs"
nil
cljs.user=> (time (do (frequencies s) nil))
"Elapsed time: 1341.280391 msecs"
nil

💥 1
mfikes 2017-12-04T16:00:39.000169Z

I wish there were a better way to know who, of the people listed at https://github.com/adventofcode-clojurians/adventofcode-clojurians have finished Day 4.

borkdude 2017-12-04T16:00:55.000258Z

@mfikes The leaderboard!

mfikes 2017-12-04T16:01:04.000788Z

👍

borkdude 2017-12-04T16:01:52.000063Z

I was looking at this yesterday. There’s an API that returns JSON. Maybe we could somehow hook it up to the README?

borkdude 2017-12-04T16:02:30.000242Z

It would be a bonus puzzle 😉

mfikes 2017-12-04T16:03:04.000053Z

What I really want to do: Survey each solution, trying to pick out novel aspects that never crossed my mind or made better use of core fns.

dpsutton 2017-12-04T16:04:03.000330Z

^ yeah. be nice to see a curated list of different interesting aspects

👍 1
borkdude 2017-12-04T16:05:06.000222Z

That would be a manual effort I guess but worth doing!

mfikes 2017-12-04T16:05:49.000276Z

What I’m interested in, from a learning perspective for example. If you are doing (= (count (distinct xs)) (count xs)), there is a core predicate that makes this trivial.

borkdude 2017-12-04T16:06:33.000053Z

Yes, or (set xs) is what I was doing

mfikes 2017-12-04T16:06:54.000108Z

In fact, this core predicate, is almost cheating—it nearly solves Day 4 with one fn.

borkdude 2017-12-04T16:07:22.000753Z

Two things I learned today: distinct? and normalize data if you want to compare it on one property (without actually generating solutions which you don’t need).

mfikes 2017-12-04T16:08:18.000629Z

By “normalize data,” are you thinking of the sort in day 4 part 2?

borkdude 2017-12-04T16:09:01.000406Z

Yes, maybe projection is the better word: sort and frequencies are a projection of anagrams into a smaller search space

borkdude 2017-12-04T16:09:34.000710Z

Maybe there are other projections possible

mfikes 2017-12-04T16:10:32.000214Z

Yes, need to dig up one of my math books, the term they use for your “projection” is “hash”, when applied to the concept of defining a partition (induced by an equivalence relation)

dpsutton 2017-12-04T16:29:56.000357Z

the math term i'd think applied would be an injection or an embedding. embed the underlying representation into its equivalence class

dpsutton 2017-12-04T16:30:08.000490Z

A -> equivalence classes over A

borkdude 2017-12-04T16:34:24.000701Z

> In mathematics, a projection is a mapping of a set (or other mathematical structure) into a subset (or sub-structure) https://en.wikipedia.org/wiki/Projection_(mathematics) > In mathematics, an injective function or injection or one-to-one function is a function that preserves distinctness https://en.wikipedia.org/wiki/Injective_function > In mathematics, an embedding (or imbedding[1]) is one instance of some mathematical structure contained within another instance https://en.wikipedia.org/wiki/Embedding It might be taste, but I find projection the most fitting, or hash if you’re programming 🙂

borkdude 2017-12-04T16:35:14.000466Z

Embedding seems to be about groups, category theory etc.

dpsutton 2017-12-04T16:47:27.000386Z

embedding is structural preserving. most examples are the copies of the naturals in the integers, integers in the rationals, rationals in the reals, etc

dpsutton 2017-12-04T16:47:43.000577Z

so since this would throw away structure it's not the right usage

dpsutton 2017-12-04T16:47:54.000004Z

(or add structure)

borkdude 2017-12-04T16:49:49.000354Z

ah yes, it was nice when I got those classes about countability, etc. https://en.wikipedia.org/wiki/Countable_set

borkdude 2017-12-04T16:51:11.000268Z

There seems to be no name for a function (which is a projection) that is nor injective, bijective and surjective

borkdude 2017-12-04T16:51:44.000281Z

With the word projection I think of physics where you see the light being concentrated through a lense.

mfikes 2017-12-04T16:59:28.000008Z

There are functions that tend to be named with the suffix -by, which take a function which essentially maps the values prior to doing whatever that function was going to do. Maybe there is a curiously recurring concept there.

mfikes 2017-12-04T17:01:47.000513Z

Apropos to the AoC problem, distinct-by is a common one. For example https://github.com/clojure/clojurescript/blob/544c1b77d76d48f234cdb03746ea993158c46aff/src/main/clojure/cljs/util.cljc#L286-L297

borkdude 2017-12-04T17:09:10.000329Z

we also use distinct-by in JVM clojure. It would be cool if there was also a distinct-by?, that would be effectively the solution for part 2 with sort or frequencies as a key

borkdude 2017-12-04T17:16:28.000375Z

@mfikes Looking at that link, wondering what they use Levenshtein for

mfikes 2017-12-04T17:17:14.000127Z

It is used to find compiler configuration keys that are slightly off

borkdude 2017-12-04T17:17:57.000038Z

and then it gives a suggestion: “did you mean…” or does it blindly accept it

mfikes 2017-12-04T17:18:14.000597Z

https://dev.clojure.org/jira/browse/CLJS-1492

borkdude 2017-12-04T17:19:15.000305Z

awesome

mfikes 2017-12-04T17:20:23.000340Z

(This was an attempt to validate configuration, prior to Spec’s release.)

borkdude 2017-12-04T17:21:41.000632Z

Levenshtein + spec could still be cool 🙂

borkdude 2017-12-04T17:23:55.000291Z

as a layer on top maybe, or does the user now get a raw spec error message?

borkdude 2017-12-04T17:24:20.000002Z

(haven’t messed around with cljs compiler config for a while, it’s been the same for a while)

val_waeselynck 2017-12-04T19:31:47.000276Z

@mfikes pretty much the same for me, with frequencies instead of sort

2017-12-04T19:46:28.000193Z

i like the advent of code repo, i've already picked some nice tricks

borkdude 2017-12-04T19:46:58.000305Z

@chrisblom welcome to the repo, just merged your PR

borkdude 2017-12-04T19:47:14.000416Z

@chrisblom I think we also met at EuroClojure 2016 if I’m not mistaking

2017-12-04T19:48:04.000091Z

ah yes, we were on the same bus & had coffee

mfikes 2017-12-04T19:50:23.000465Z

@borkdude The ClojureScript compiler doesn’t use Spec to validate compiler configuration. On the other hand, I believe Figwheel uses this lib https://github.com/bhauman/strictly-specking

val_waeselynck 2017-12-04T20:16:53.000586Z

What are you guys using for parsing inputs? I find it rather tedious, I wish I could find some pattern-matching lib to speed up the process

val_waeselynck 2017-12-04T20:18:58.000429Z

I realize parsing has not been much of a problem so far in AoC 2017, but as I'm working through some problems from last year I find them more and more demanding in this regard

2017-12-04T20:27:33.000631Z

usually instaparse for complex things, otherwise clojure core & string function

borkdude 2017-12-04T20:27:42.000024Z

usually just str/split etc, but at one point clojure.spec, although I first did it with regexes, which was good enough

2017-12-04T20:29:48.000244Z

I’m solving in cljs, planck so .split. tbh I used it today for the first time

2017-12-04T20:30:19.000428Z

todays puzzle is hilariously straightforward

borkdude 2017-12-04T20:32:36.000306Z

I didn’t solve all of last year’s problems. Can you give an example of more complex parsing problems there?

mfikes 2017-12-04T20:33:38.000235Z

@nooga For problems involving parsing integers, frequently Clojure solutions involve clojure.core/read-string as opposed to Long/parseLong. FWIW, Planck now has planck.core/read-string in master. (For now, I’ve just been using js/parseInt.)

mfikes 2017-12-04T20:34:26.000282Z

It was distinctly easy 😜

2017-12-04T20:34:49.000356Z

oh, I just wrap numeric tables with [] in emacs and paste them into the repl

2017-12-04T20:35:05.000433Z

too lazy to create files

2017-12-04T20:36:00.000484Z

and applying map will sort the second part ;D

borkdude 2017-12-04T20:36:48.000482Z

This guy doesn’t even need an editor: https://www.reddit.com/r/adventofcode/comments/7hf5xb/2017_day_4_solutions/dqqjrq2/

mfikes 2017-12-04T20:36:59.000330Z

Right 🙂 Previously I was even wrapping strings with '[] and just working on the resulting symbols

borkdude 2017-12-04T20:37:43.000180Z

@mfikes That’s what I’ve also done. Wrap in [], then clojure.edn/read-string and process the rest using clojure.spec 🙂

mfikes 2017-12-04T20:38:29.000338Z

Hey, since we are working in a language that is so data-centric, it doesn’t feel like cheating to paste the data into the source file.

😂 1
borkdude 2017-12-04T20:39:24.000281Z

Some people do this to avoid the IO monad 😉

val_waeselynck 2017-12-04T21:02:38.000625Z

@borkdude @mfikes clever!

val_waeselynck 2017-12-04T21:02:49.000027Z

I meant for problems like this one: https://adventofcode.com/2016/day/23

2017-12-04T21:37:27.000470Z

I’d totally quote that

borkdude 2017-12-04T21:51:30.000290Z

@val_waeselynck for that input i’d use the mentioned [] + read-string approach and then simply destructuring + case for processing

bhauman 2017-12-04T23:10:58.000217Z

My solutions for day 3 and doy 4 are posted...

bhauman 2017-12-04T23:11:13.000430Z

now to check everyone else's