What's a good way to find sum of any two elements in a given array?
I have the following code, but it looks kind of ugly
def sum_to_n?(a, n)
sums = []
a.each_index do |i|
b = a.drop(i+1)
b.each_index do |j|
sums << a[i] + b[j]
end
end
end
method?name should return a boolean, it's a convention.