Matching Socks
Time limit0.5sMemory limit1024 MB
Given five digits where two pairs can be formed, print the single digit that has no matching partner.
- Level
Easy1 of 10
- Topics
- Hash map
- Solved
- No attempts yet
Problem
There are socks. Each sock has one number written on it. When two socks with the same number are put together, they form a pair.
What number is written on the sock that remains after removing two pairs of socks that can be made into pairs?
Input
Five numbers, one for each sock, are given one per line. Every number in the input is between and , inclusive. The input always allows two pairs of socks to be formed.
Output
On the first line, print the number written on the remaining sock.