@mohan, when the num of repeatation is bigger than 1, it may be wrong,please
check {1, 1, 2, 5, 6, 6}On Fri, Dec 10, 2010 at 12:41 PM, mo...@ismu <[email protected]> wrote: > 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]<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.
