Every value in nums appears exactly three times, except one value that appears once. Return that value. Use O(1) extra memory if you can (counting with a dictionary is allowed, but the challenge is to do it without one).
Example 1
Input:
single_number_ii([2, 2, 3, 2])
Output:
3
Example 2
Input:
single_number_ii([0, 1, 0, 1, 0, 1, 99])
Output:
99
1 <= len(nums) <= 300000len(nums) % 3 == 1-2**31 <= nums[i] < 2**31No results yet
Run your code to check it against the examples, or submit to run every test.