Design an algorithm to find all pairs of integers within an array which sum to a specified value.
I have tried this problem using a hash
Assume required sum = R