You are viewing a single comment's thread. Return to all comments →
public static int sansaXor(List arr) { // Write your code here int n = arr.size(); int c = 0;
if (n % 2 == 0) { return 0; } for (int i = 0; i < n; i += 2) { c ^= arr.get(i); } return c;
}
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 →
public static int sansaXor(List arr) { // Write your code here int n = arr.size(); int c = 0;
}