AK
Size: a a a
AK
w
w
w
AK
w
МК
МК
AK
AK
h ={}
result = []
ar.each_with_index do |i, a|
ar[i, -1].each do |b|
sum = a+b
h[sum] ||= 0
h[sum] += 1
result << sum if h[sum] == 1
end
end
puts result
w
h ={}
result = []
ar.each_with_index do |i, a|
ar[i, -1].each do |b|
sum = a+b
h[sum] ||= 0
h[sum] += 1
result << sum if h[sum] == 1
end
end
puts result
AK
AK
w
w
w
МК
AK
МК
w