Basic 2 sum problem. Finding pair of numbers that add to current sum.
Anonymous
put all numbers in a hashtable (number -> # of shows) then, for each number, calculate its expected counterpart (sum minus first) and test if contained in the hashtable. if first=expected, number of shows in hashtable shall be >1. Avegage: O(n)
Check out your Company Bowl for anonymous work chats.