wu :: forums (http://www.ocf.berkeley.edu/~wwu/cgi-bin/yabb/YaBB.cgi)
riddles >> cs >> Find 2 numbers in array whose sum is equal to x
(Message started by: puzzlefreak on Aug 24th, 2011, 1:05am)

Title: Find 2 numbers in array whose sum is equal to x
Post by puzzlefreak on Aug 24th, 2011, 1:05am
Given an array, find first 2 numbers whose sum is equal to x. For eg :-
consider an array :- [1,2,3,4,5,6,7,8,9,10]
if x = 10, then 1+9 is the answer.
(please don't use brute force approach)

Title: Re: Find 2 numbers in array whose sum is equal to
Post by puzzlefreak on Aug 24th, 2011, 10:03am
Sorry this question is already asked before :-

http://www.ocf.berkeley.edu/~wwu/cgi-bin/yabb/YaBB.cgi?board=riddles_cs;action=display;num=1216836886;start=2#2



Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board