回答編集履歴
1
Update
answer
CHANGED
@@ -1,9 +1,12 @@
|
|
1
1
|
こういう事でしょうか?
|
2
2
|
|
3
3
|
```ruby
|
4
|
-
S.each_with_index.map{|r, i|
|
4
|
+
num_sum = S.each_with_index.map{|r, i|
|
5
5
|
r.each_with_index.map{|c, j|
|
6
6
|
c == "o" ? Z[i][j].to_i : 0
|
7
7
|
}
|
8
8
|
}.reduce(:+).sum
|
9
|
+
|
10
|
+
p num_sum
|
11
|
+
#=> 29
|
9
12
|
```
|