Re: [algogeeks] Re: Interview Question

2011-07-02 Thread Pranav Agarwal
I think that the above algo will fail for the following two arrays: a={2,2,3,3} b={4,4,1,1} sum(a)=sum(b); a^b=0; len(a)=len(b); Correct me if i am wrong! Pranav On Sun, Jul 3, 2011 at 7:43 AM, varun pahwa varunpahwa2...@gmail.comwrote: @aditya. xor all elements mean that. take xor of each

Re: [algogeeks] maximize result

2010-12-18 Thread Pranav Agarwal
I am not sure about this but a quick thought on the question: If we give plus a higher precedence than multiplication, then we get a higher result. For eg: 3 + 6 * 7 + 3 * 2 BODMAS = 51 But giving plus a higher precedence will imply 180 Unable to think of any counter examples. Give if any,