Lone Integer

You are given a list of integers nums where each integer occurs exactly three times except for one which occurs once. Return the lone integer.

Bonus: can you do it in O(1) space?

Constraints

  • n ≤ 10,000 where n is length of nums

Example 1

Input

nums = [2, 2, 2, 9, 5, 5, 5]

Last updated