[2023][ruby][15.1]

main
Alpha Chen 1 year ago
parent 4fa0141f5f
commit 5bbeb5d969
Signed by: alpha
SSH Key Fingerprint: SHA256:3fOT8fiYQG/aK9ntivV3Bqtg8AYQ7q4nV6ZgihOA20g

@ -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…
Cancel
Save