137. Single Number II

Practice Single Number II for free on NudgeCode: Medium, Bit Manipulation pattern. Write it in Python or JavaScript, run the tests in your browser, and ask for a hint when you are stuck.

In nums, one value appears exactly once and every other value appears exactly three times. Return the value that appears once. Values are signed 32-bit integers and may be negative. Aim for O(n) time and O(1) extra space.

Example

nums = [2,2,3,2]            ->  3
nums = [0,1,0,1,0,1,99]     ->  99

Constraints