We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Isnt a great exercise, it requires you to know the attributes of XOR:
Namely:
Associatitive A^(B^C) = (A^B)^C
Commutative A^B = B^A
Self inverse: A^A = 0
The first and second example written down, gives you some clue:
The 4 elements and up being even number of A's (if you call first number A) and also all other nunebrs. Therefore it will be always 0.
The first example written down A,B,C ends up A^B. But not because they are on the edge, but rather the indexes being even.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Sansa and XOR
You are viewing a single comment's thread. Return to all comments →
Isnt a great exercise, it requires you to know the attributes of XOR: Namely: Associatitive A^(B^C) = (A^B)^C Commutative A^B = B^A Self inverse: A^A = 0
The first and second example written down, gives you some clue: The 4 elements and up being even number of A's (if you call first number A) and also all other nunebrs. Therefore it will be always 0. The first example written down A,B,C ends up A^B. But not because they are on the edge, but rather the indexes being even.