Knowsh.com

Program to find all the pairs in the given set that add up to a certain sum

http://www.knowsh.com

Given a set of numbers -50 to 50, find all pairs that add   up to a certain sum that is passed in. Implement the O(n) solution. Asked in Microsoft Interview.

All Possible types of the pairs:-
-33 + 50 = 17
-17 + 34 = 17
-16 + 33 = 17
10 + 07 = 17
-10 + 27 = 17

http://knowsh.com/Notes/NotesSearch/NotesDetail/140226/Program-To-Find-All-The-Pairs-In-The-Given-Set-That-Add-Up-To-A-Certain-Sum

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s