parent
4fa0141f5f
commit
5bbeb5d969
@ -0,0 +1,12 @@
|
||||
input = ARGF.read.strip.split(?,).map(&:chars)
|
||||
|
||||
# part one
|
||||
p input.sum {|str|
|
||||
current = 0
|
||||
str.each do |c|
|
||||
current += c.ord
|
||||
current *= 17
|
||||
current %= 256
|
||||
end
|
||||
current
|
||||
}
|
Loading…
Reference in new issue