Skip to main content
PreparationZone Logo
PreparationZone
Back to Coding

Coding · Hard · Pro

Find the two numbers that appear once (others twice)

CodingBit ManipulationStaff
Model answerPreview

Approach

  • XOR all → xor = a ^ b.
  • Find any set bit in xor to partition nums.
  • XOR each partition separately.

Java Solution

Java
int[] singleNumbers(in…