badges. Each employee passes through once or twice a day, so every number shows up in the log either once or twice.
Return the bitwise XOR of all numbers that appear in the log **exactly twice**. If there are none, return 0.badges=[7, 3, 7, 12] → 7
Only badge 7 was scanned twice, so the answer is 7.
badges=[5, 9, 9, 5, 4] → 12
Badges 5 and 9 appear twice: 5 XOR 9 = 0101 XOR 1001 = 1100 = 12.
badges=[2, 8, 6] → 0
Nothing repeats, so the result is 0.
badges.length ≤ 50badges[i] ≤ 50badges once or twicebadges=[7, 3, 7, 12]
7
Run checks the first 3 tests in your browser. Submit checks all 83 tests on the server, hidden ones included.