Skip to content

Instantly share code, notes, and snippets.

Avatar

Gerasimos g7s

View GitHub Profile
@g7s
g7s / day1.clj
Last active Dec 1, 2020
Advent of Code 2020 - Day 1
View day1.clj
(defn sum-pair
[target nums]
(when (pos? (count nums))
(let [min-el (get nums 0)
max-el (peek nums)]
(case (compare (+ min-el max-el) target)
1 (recur target (pop nums))
-1 (recur target (subvec nums 1))
0 [min-el max-el]))))
View keybase.md

Keybase proof

I hereby claim:

  • I am g7s on github.
  • I am g7s (https://keybase.io/g7s) on keybase.
  • I have a public key ASCrJVdh453xZQORNELSm5pN1o-Q-tlinjYHOcbOUxWS2Qo

To claim this, I am signing this object: