You are viewing a single comment's thread. Return to all comments →
c++, crazy Sansa, nice
int sansaXor(vector<int> arr) { const int n = arr.size(); if (n % 2 == 0) { return 0; } int x = 0; for (int i = 0; i < n; i += 2) { x ^= arr[i]; } return x; }
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 →
c++, crazy Sansa, nice