parent
06068a3114
commit
cba5517ee9
@ -0,0 +1,9 @@
|
||||
input = ARGF.readlines(chomp: true).map(&:chars)
|
||||
|
||||
p input.transpose
|
||||
.map {|col| col.chunk_while { [_1, _2].tally.fetch(?#, 0).even? }}
|
||||
.map {|col| col.flat_map { _1.sort.reverse }}
|
||||
.transpose
|
||||
.reverse
|
||||
.each.with_index
|
||||
.sum {|row, i| row.count(?O) * (i+1) }
|
Loading…
Reference in new issue