Skip to content

Commit

Permalink
Adding day 6
Browse files Browse the repository at this point in the history
  • Loading branch information
carolyncole committed Dec 6, 2022
1 parent 028d5ab commit 3ae3d57
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions day6/script.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
require 'byebug.rb'

bytes= File.read("input.txt").split("")
start_idx = 0
bytes.each_with_index do |_val,idx|
#byebug
if bytes[idx..idx+13].tally.values.max == 1
start_idx = idx
break
end
end
puts bytes.join("")
puts start_idx + 14

0 comments on commit 3ae3d57

Please sign in to comment.