@Ankur : i guess this would work but to your test add one more sizeof(arr);
On Wed, Jan 4, 2012 at 10:00 PM, Ankur Garg <[email protected]> wrote: > sorry it shud be > sum of squares and xor and sumof elements > > I think this shud work > > Regards > Ankur > > > > > On Wed, Jan 4, 2012 at 9:52 PM, atul anand <[email protected]>wrote: > >> @ Karthikeyan : >> >> sum of cubes fails:- >> >> arr1={2,3,0,-3} = 4 >> arr2={1,1,1,1} = 4 >> >> On Wed, Jan 4, 2012 at 6:53 PM, Karthikeyan V.B <[email protected]>wrote: >> >>> Hi, >>> >>> Consider, arr1={1,2,3} and arr2={-1,-2,-3} >>> >>> using sum of squares method sum(arr1) = 14 ans sum(arr2) = 14 (since >>> square of 1 and -1 is 1) >>> >>> so it won work with this case >>> >>> 1.better take the square and negate it before adding >>> or >>> 2.take sum of cubes >>> >>> pls correct me if i'm wrong >>> >>> Regards, >>> Karthikeyan >>> PSG TECH >>> >>> -- >>> 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. >>> >> >> -- >> 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. >> > > -- > 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. > -- 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.
