aboutsummaryrefslogtreecommitdiff
path: root/day01/part1
diff options
context:
space:
mode:
authorNat Lasseter <user@4574.co.uk>2019-12-01 11:15:09 +0000
committerNat Lasseter <user@4574.co.uk>2019-12-01 11:15:09 +0000
commitb1692f98b614e731cd42fc770dff77e2f3c136ff (patch)
tree5066dfa5a78db90279ceaec6b5a87049f06973c8 /day01/part1
parent04dbc1e0b9c56198168190d45fa096c605cafd7f (diff)
Day 1 complete
Diffstat (limited to 'day01/part1')
-rwxr-xr-xday01/part15
1 files changed, 5 insertions, 0 deletions
diff --git a/day01/part1 b/day01/part1
new file mode 100755
index 0000000..6d82338
--- /dev/null
+++ b/day01/part1
@@ -0,0 +1,5 @@
+#!/usr/bin/env ruby
+
+input = $stdin.readlines.map(&:strip).map(&:to_i)
+
+puts input.map{ |x| (x / 3) - 2 }.sum