Hey all, I've got my repo up https://github.com/bhauman/advent-of-clojure-2016 there's also a link to last years solutions as well. I'm open to discussion.
PFFF. And done.
Clojure was made for this ❤️
Well, LISP
Yeah that was easiest so far...
what rank did you get?
I got 459 and 419. It is my best total for one day, but not my best for any 1 part.
45 and 37 😄
awesome!
Transpose once again saves the day, so glad I have that stowed in my core for this
ahh transpose...
I will refactor to use that... I wrote my own and called it pivot.
See I'm learning already!
Thank you 😉
That's a good name too 😄
I'm just used to calling it transpose from matrix algebra hahah
Is there a transpose
?
Not in the core lib, I just have one defined in my core file for quick importing, since these problems seem to use it frequently
(defn transpose
"Transposes the given nested sequence into nested vectors, as
in matrix transposition. E.g., (transpose [[1 2 3] [4 5 6]])
would return [[1 4] [2 5] [3 6]]."
[s]
(vec (apply map vector s)))
Presumes rectangular input.
Oh I did that as well
I found a transpose in clojure.core.matrix
but then I ended up using (apply mapv vector data)
Oooh I forgot about mapv
, good call...