i thought the same way, but in this case 4 is being repeated twice, but is not nullified!!!!
it is ctually getting nullified, but it is indeed contributing to bit 2 so how do i rule out 4 here? Best Regards Ashish Goel "Think positive and find fuel in failure" +919985813081 +919966006652 On Wed, Jul 7, 2010 at 10:17 AM, Anand <anandut2...@gmail.com> wrote: > if we xor all elements of the array, then the element which are repeated > twice and multiple of two gets nullify and what left is the number which got > repeated once and thrice. if we can find the number which got repeated once, > then we can xor that number from the total xor value to get the element > which got repeated thrice. > > > On Tue, Jul 6, 2010 at 9:37 PM, Ashish Goel <ashg...@gmail.com> wrote: > >> can i take this as a sample array? >> >> 1,1,2,2,3,3,4,4,4,5,5,5,5 >> >> or >> >> 1,2,3,4,4,5,5,5 >> >> ideally a bit map would suffice for identification of repeating numbers, >> but the memory requirements shoot up >> >> >> 0001 >> 0010 >> 0011 >> 0100 >> 0100 >> 0101 >> 0101 >> 0101 >> >> xor result = 0101, how to proceed further..?? >> >> Best Regards >> Ashish Goel >> "Think positive and find fuel in failure" >> +919985813081 >> +919966006652 >> >> >> On Mon, Jul 5, 2010 at 7:18 PM, jalaj jaiswal >> <jalaj.jaiswa...@gmail.com>wrote: >> >>> Given an array of integers where some numbers repeat 1 time, some numbers >>> repeat 2 times and only one number repeats 3 times, how do you find the >>> number that repeat 3 times. >>> >>> can xor do something here ?? >>> >>> -- >>> With Regards, >>> Jalaj Jaiswal >>> +919026283397 >>> B.TECH IT >>> IIIT ALLAHABAD >>> >>> -- >>> 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<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<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.