Manipulative Numbers Discussions | Algorithms | HackerRank
  • + 0 comments

    Why the second test case answer is 25 ?

    May be I understood something worng .. Here is the steps of my solution: 1. I got the array of numbers A 2. I Xor first element with the rest of elements starting from element two, and then the second element with the rest of the elements starting element three, and so on. 3. Now I have a list with all numbers xored, I sort them and get the first element in xored list and applied this equation to it :- int k = (int) log (xoredList[0]) / log (2);

    and in the second test case it gives me 9 not 25

    I think, I miss understand something .. can anyone help me ?!