Question: Given an unsorted array of positive integers, is it possible to find a pair of integers from that array that sum up to a given sum?
Constraints: This shou
Ruby implementation
ar1 = [ 32, 44, 68, 54, 65, 43, 68, 46, 68, 56] for i in 0..ar1.length-1 t = 100 - ar1[i] if ar1.include?(t) s= ar1.count(t) if s < 2 print s , " - " , t, " , " , ar1[i] , " pair ", i, "\n" end end end