blakeembrey/code-problems — pull request #107 by windor (2014-03-24 13:03:16+00:00)
Title: solution to array pair sum in ruby and scala

Here is my solutions to [array-pair-sum](https://github.com/blakeembrey/code-problems/tree/master/problems/array-pair-sum) problem, and the codes in ruby and scala use the same approach:

1. change the num array to a hash containing the num and the corresponding count.
2. for each k/v pair, check if (total - k) exists in the hash.
3. if k == (total - k), check if the count of k is greater than 1.
4. flat map each result.

Comments appreciated!