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!