How do you do this? The values are unsorted but are of [1..n] Example array [3,1,2,5,7,8]. Answer: 4, 6
[1..n]
[3,1,2,5,7,8]
4, 6
I saw this solution in
Java implementation: (Based on @Ben Voigt)
BigInteger fact=1; int sum=0; int prod=1; int x,y; // The 2 missing numbers int n=a.length; int max=MIN_VALUE; for (int i=0; i