Single Number II

Given an array of integers, every element appears thrice except for one which occurs once.

Find that element which does not appear thrice.

Note: Your algorithm should have a linear runtime complexity.

Could you implement it without using extra memory?

Example :

Input : [1, 2, 4, 3, 3, 2, 2, 3, 1, 1]
Output : 4
Interview Code Editor
Hints
  • Hint 1
  • Solution Approach
  • Complete Solution
5479 successful submissions.
Asked In:
  • Google
  • Amazon
Click here to jump start your coding interview preparation