回答編集履歴

1

2023/03/01 01:47

投稿

melian
melian

スコア19825

test CHANGED
@@ -2,7 +2,7 @@
2
2
  answers = ["apple","peach","orange"]
3
3
  fruits = ["aplle","peech","olaege"]
4
4
 
5
- p answers.zip(fruits).map{|a, b| a.chars.zip(b.chars).count{|a, b| a != b} == 1 ? 1 : 0}.sum
5
+ p answers.zip(fruits).map{|a, b| a.chars.zip(b.chars).count{|a, b| a != b}}.count(1)
6
6
 
7
7
  # 2
8
8
  ```