Skip to content

Commit

Permalink
Changed code + added note
Browse files Browse the repository at this point in the history
  • Loading branch information
Unihedro committed Dec 5, 2018
1 parent 269dd84 commit 6023fa0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion adventofcode2018/day05.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
a.chars{|x|g[-1].downcase==x.downcase && g[-1] != x ? (g[-1]='') : g<<x}
p g.strip.size

a=g.strip
a=g.strip # This line is added afterwards because all initial reductions also apply regardless of which letter to take away, so part 1 can be used as a first pass
p a.downcase.chars.uniq.map{|x|g=' '
a.chars.reject{|y|y.downcase==x}.each{|x|g[-1].downcase==x.downcase && g[-1] != x ? (g[-1]='') : g<<x}
g.strip.size
Expand Down

0 comments on commit 6023fa0

Please sign in to comment.