1. First find the sum of all given elements.: sum 2. find the sum of elements in the given range. : sum_1 3. Find the duplicates.: d 4. Missing Number: sum-sum_1+d.
http://codepad.org/77Nr9Hay <http://codepad.org/77Nr9Hay> On Wed, Sep 1, 2010 at 9:50 AM, Raj Jagvanshi <[email protected]>wrote: > in ur algo i confuse in solving eqn > > > On Wed, Sep 1, 2010 at 6:31 PM, Dave <[email protected]> wrote: > >> @Raj: Best what? >> >> Dave >> >> On Sep 1, 12:08 am, Raj Jagvanshi <[email protected]> wrote: >> > Thanks Dave >> > but i want best >> > >> > >> > >> > On Wed, Sep 1, 2010 at 7:14 AM, Dave <[email protected]> wrote: >> > > Suppose that x is duplicated and y is omitted. Then the sum of the >> > > numbers would be 5050 + x - y. Similarly, the sums of the squares of >> > > the numbers would be 338,350 + x^2 - y^2. Calculate the sum and sum of >> > > squares of the numbers and solve the resulting equations for x and y. >> > >> > > Dave >> > >> > > On Aug 31, 1:57 pm, Raj Jagvanshi <[email protected]> wrote: >> > > > There is an array having distinct 100 elements from 1 to 100 >> > > > but by mistake some no is duplicated and a no is missed. >> > > > Find the duplicate no and missing no. >> > >> > > > Thanks >> > > > Raj Jagvanshi >> > >> > > -- >> > > You received this message because you are subscribed to the Google >> Groups >> > > "Algorithm Geeks" group. >> > > To post to this group, send email to [email protected]. >> > > To unsubscribe from this group, send email to >> > > [email protected]<algogeeks%[email protected]> >> <algogeeks%2bunsubscr...@googlegroups.com> >> > > . >> > > For more options, visit this group at >> > >http://groups.google.com/group/algogeeks?hl=en.- Hide quoted text - >> > >> > - Show quoted text - >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]<algogeeks%[email protected]> >> . >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> >> > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<algogeeks%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
