Loading...
Loading...
Loading...
A warehouse scans parcels in pairs, but one parcel code has no partner because its twin was lost. Every other code appears exactly twice. Print the code that appears once.
Example 1
Input
5 4 1 2 1 2
Output
4
4 has no partner.
Example 2
Input
1 9
Output
9
Try the problem first. Open one hint at a time.
Equal numbers cancel out under the exclusive-or operator ^.
Start from 0 and combine every code with ^.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor