Odd One Out (Codeforces 1915A)
Tags: Implement, bitmasks

You are given three digits $$$a$$$, $$$b$$$, $$$c$$$. Two of them are equal, but the third one is different from the other two. Find the value that occurs exactly once.

Input: The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 270$$$) — the number of test cases.The only line of each test case contains three digits $$$a$$$, $$$b$$$, $$$c$$$ ($$$0 \leq a$$$, $$$b$$$, $$$c \leq 9$$$). Two of the digits are equal, but the third one is different from the other two.

Output: For each test case, output the value that occurs exactly once.


Sample Inputs:
10
1 2 2
4 3 4
5 5 6
7 8 8
9 0 9
3 6 3
2 8 2
5 7 7
7 7 5
5 7 5

Sample Outputs:
1
3
6
7
0
6
8
5
5
7

Solution (Python):
def find_unique_digit(a, b, c):
    if a == b:
        return c
    elif a == c:
        return b
    else:
        return a
t = int(input())
for _ in range(t):
    (a, b, c) = map(int, input().split())
    print(find_unique_digit(a, b, c))

Solution (Python):
tests = int(input())
for _ in range(tests):
    (a, b, c) = list(map(int, input().split()))
    if a == b:
        print(c)
        continue
    print(b if a == c else a)

Solution (Python):
n = int(input())
for i in range(n):
    a = list(map(int, input().split()))
    if a[0] == a[1]:
        print(a[2])
    elif a[0] == a[2]:
        print(a[1])
    else:
        print(a[0])