Tap here to switch tabs
Problem
Submissions

Problem: Single Number III

Single Number III gives you an integer array where every value appears twice except two distinct values that appear once. Return those two unique values in any order.

Statement

Given an integer array nums where every value occurs exactly twice except for two distinct values that occur exactly once, return the two values that appear only once. The returned order can be arbitrary.

Constraints:

  • 2≤2 \leq nums.length ≤3⋅104\leq 3 \cdot 10^4

  • −231≤-2^{31} \leq nums[i] ≤231−1\leq 2^{31} - 1

  • Every integer in nums appears exactly twice, except for exactly two integers that appear once

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Single Number III

Single Number III gives you an integer array where every value appears twice except two distinct values that appear once. Return those two unique values in any order.

Statement

Given an integer array nums where every value occurs exactly twice except for two distinct values that occur exactly once, return the two values that appear only once. The returned order can be arbitrary.

Constraints:

  • 2≤2 \leq nums.length ≤3⋅104\leq 3 \cdot 10^4

  • −231≤-2^{31} \leq nums[i] ≤231−1\leq 2^{31} - 1

  • Every integer in nums appears exactly twice, except for exactly two integers that appear once