New update is available. Click here to update.
Close
Topic list
Single Number
EASY
10 mins
18 upvotes
Arrays
Bit Manipulation
Topics (Covered in this problem)
Problem solved
Badge
Skill meter
Arrays
-
-
Bit Manipulation
-
-
Other topics
Problem solved
Badge
Skill meter
Strings
-
-
Matrices (2D Arrays)
-
-
Linked List
-
-
Sorting
-
-
Binary Search
-
-
Stacks & Queues
-
-
Trees
-
-
Graph
-
-
Dynamic Programming
-
-
Greedy
-
-
Tries
-
-
SQL
-
-
Binary Search Trees
-
-
Heap
-
-
Solve problems & track your progress
Checkout your overall progress in every topic here
Become
Sensei
in DSA topics
Open the topic and solve more problems associated with it to improve your skills
Check out the skill meter for every topic
See how many problems you are left with to solve for cracking any stage. Score more than zero to get your progress counted.

# Single Number

Contributed by
Naresh
Easy
0/40
Avg time to solve 10 mins
Success Rate 90 %
Share
18 upvotes

## Problem Statement

#### Note: There are (N-1)/2+1 elements that are unique in the array.

Detailed explanation ( Input/output format, Notes, Constraints, Images )
##### Sample Input 1:
``````2
7
7 3 5 4 5 3 4
9
5 6 9 6 1 9 1 5 3
``````
##### Sample Output 1:
``````7
3
``````
##### Explanation For Sample Input 1:
``````In the first test case the integers 3, 4, 5 occur twice and only the integer 7 occurs once.

In the second test case the integers 1, 5, 6, 9 occur twice and only the integer 3 occurs once.
``````
##### Sample Input 2:
``````3
1
5
3
6 9 6
5
6 9 3 6 3
``````
##### Sample Output 2:
``````5
9
9
``````
Auto
Console