All Problems

Problem title

Difficulty

Avg time to solve

Minimum steps to reach target by a Knight

Moderate

25 mins

Diamond of Stars

Easy

10 mins

Maximum Frequency Number

Easy

10 mins

Kth smallest node in BST

Moderate

15 mins

Construct BST from Level Order

Easy

15 mins

Find Non - Repeating Numbers

Easy

15 mins

Restore IP Addresses

Moderate

15 mins

Binary Tree Zigzag Traversal

Easy

15 mins

Find The Repeating And Missing Number

Easy

10 mins

Circularly Linked

Easy

15 mins

Problem

Submissions

15

Difficulty: EASY

Avg. time to solve

15 min

Success Rate

85%

Problem Statement

```
If the given array is [ 4, 7, 3, 2, 7, 2 ], you have to find ‘4’ and ‘3’ as 4 and 3 occur one time, and the rest of the elements ( 7 and 2 ) are occurring twice.
```

```
The first line contains a single integer T representing the number of test cases.
The first line of each test case contains a single integer ‘N’, denoting the number of elements in the array.
The second line of each test case contains ‘N’ space-separated integers denoting the elements of the given array.
```

```
For each test case, print two space-separated integers that denote the two non-repeating numbers in the given array.
Print the output of each test case in a new line.
```

```
You do not need to print anything. It has already been taken care of. Just implement the given function.
```

```
1 <= T <= 10
4 <= N <= 10^5
1 <= A[i] <= 10^5
Time Limit: 1 sec
```

```
2
4
2 4 7 2
8
3 9 3 1 4 8 1 9
```

```
4 7
4 8
```

```
Test Case 1: The given array is [ 2, 4, 7, 2 ]. 4 and 7 are the two non-repeating numbers. Hence the output will be 4 and 7.
Test Case 2: Numbers 3, 1, 9 occurs two times while 4 and 8 occur once. Hence the output will be 4 8
```

```
2
6
11 2 6 11 6 5
4
3 5 5 7
```

```
2 5
3 7
```

Java (SE 1.8)

Console

Sample Test Case

Custom Test Case

Download Test Cases

Test Case 1

Test Case 2

Test Case 3

Full Screen Mode

Change Theme

Solution submission not allowed

Save Code

Reset Code