You are viewing a single comment's thread. Return to all comments →
In JAVA8 :
public static long sumXor(long n) { // Write your code here long count = 0; while (n > 0) { if ((n & 1) == 0) { count++; } n >>= 1; } return 1L << count; }
Seems like cookies are disabled on this browser, please enable them to open this website
Sum vs XOR
You are viewing a single comment's thread. Return to all comments →
In JAVA8 :