Single number appearing once
Your task
Every element in the integer array nums appears exactly three times except for one element which appears exactly once. Return that single element. Inputs are non-negative integers. Solve it with O(n) time and O(1) extra space (do not use a hash map or sort).
Examples
single_number_iii(nums: list[int]) -> intExample 1
Input
single_number_iii([2, 2, 3, 2])Output
3