You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
# p ARGF.read.strip.chars.map(&:to_i).each_cons(2).select {|a,b| a == b }.map(&:first).sum
|
|
|
|
a = ARGF.read.strip.chars.map(&:to_i)
|
|
b = a.rotate(a.size/2)
|
|
p a.zip(b).select {|a,b| a == b }.map(&:first).sum
|