The above solution will work if each other number is exactly once present.
but if that 's not true.
then 4 equations can be formed.
Assuming a,b repeated number where a may or may be equal to b.

then equations will be
x + y = a + b;
x^2 + y^2 = a^2 + b^2.
x.y = a.b
x^3 + y^3 = a^3 + b^3.
now 4 equations 4 variables can be solved.

On Mon, Jul 18, 2011 at 5:31 PM, ankit sambyal <[email protected]>wrote:

> 1. Initialize a bit vector of size n.
> 2. For every no. set the corresponding bit vector.
> 3. Now scan through the bit vectors and get the missing numbers
> corressponding to the unset bits in the bit vector.
>
>
> Time complexity : O(n)
>
> --
> 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.
>
>


-- 
Varun Pahwa
B.Tech (IT)
7th Sem.
Indian Institute of Information Technology Allahabad.
Ph : 09793899112
Official Email :: [email protected]
Another Email :: [email protected]

People who fail to plan are those who plan to fail.

-- 
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.

Reply via email to