solution to array pair sum in ruby
solution to array pair sum in scala, using the same way as in ruby