sum of n elements from 1=n(n+1)/2
product from 1 to n=n!
calculate dis..
sum=calculated sum-orig sum
prod=calculated prod-orig prod
with dis form quadratic eq and solve...
hope this works...
On Tue, Oct 12, 2010 at 12:29 AM, Asquare <anshika.sp...@gmail.com> wrote:

> Given an array of size n. It contains numbers in the range 1 to n.
> Each number is present at least once except for 2 numbers.
> Find the missing numbers.
>
> I know of a solution using another array to store frequency of each
> number..
> But this holds for than 2 nums also..
> So Is there any other solution apart from this specific for 2 nums and
> of lesser complexity..??
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algoge...@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com>
> .
> 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 algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to