Problem Description
Given an array of integers, every element appears thrice except for one, which occurs once.
Find that element that does not appear thrice.
NOTE: Your algorithm should have a linear runtime complexity.
Can you implement it without using extra memory?
2 <= A <= 5*106
0 <= A <= INTMAX
First and only argument of input contains an integer array A.
Return a single integer.
Input 1:
A = [1, 2, 4, 3, 3, 2, 2, 3, 1, 1]
Input 2:
A = [0, 0, 0, 1]
Output 1:
4
Output 2:
1
Explanation 1:
4 occurs exactly once in Input 1. 1 occurs exactly once in Input 2.
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a question? Checkout Sample Codes for more details.