i did nt get this xor part in adithya solution

check if  this works

array is valid if satisfy 2 conditions
1.max-min=n-1
2.there should be no repeatations

first one can be done in O(n)
for second

check 1xor2xor.......xorn=(a[1]-min+1)xor(a[2]-min+1)xor..............
if both are equal there are no repeatations

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