Solution for Day 03

This commit is contained in:
2020-12-03 10:52:37 +01:00
parent 95b04662d6
commit 5598936603
3 changed files with 358 additions and 0 deletions

12
day_03/first.rb Normal file
View File

@ -0,0 +1,12 @@
# frozen_string_literal: true
input = File.readlines './input'
width = input.first.strip.size
count = 0
input.each_with_index do |row, i|
next if i == 0
count += 1 if row[(i * 3) % width] == '#'
end
puts count