Logo
IconChallenge
Icon
IconProblem
IconSolutions
IconSubmissions

Single Number

XPChallenge Points: 10
levelLevel: Easy

You are given an array of integers nums where every element appears exactly twice, except for one unique element that appears only once.
Your task is to find and return the element that appears only once.

You must implement a solution that runs in linear time (O(n)) and uses constant extra space (O(1)).

Example 1:

Input: nums = [5, 3, 5]

Output: 3

Example 2:

Input: nums = [7, 8, 7, 9, 9]

Output: 8

to Continue
like
dislike

Accepted:

Submission:

IconReport an issue
Icon
IconCode
IconYou need toto run or submitYou need toto run or submit
IconTest Case
IconTest Result