Skip to content

Instantly share code, notes, and snippets.

@jianminchen
Created December 28, 2016 19:32
HackerRank - week code 27 - zero nim sum - submission from https://www.hackerrank.com/yaray
#include <iostream>
using namespace std;
int main()
{
cin.sync_with_stdio(0);
long cases, n, s, x = 0;
for (cin >> cases; cases--; ) {
s = 0;
cin >> n;
while (n--) {
cin >> x;
s ^= (x+1^1)-1;
}
cout << "WL"[!s] << '\n';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment