Login

Striver SDE Sheet Problems

Problem title

Difficulty

Avg time to solve

Preorder Traversal

Easy

15 mins

Postorder Traversal

Easy

15 mins

Search In BST

Easy

15 mins

Rabin Carp

Moderate

10 mins

Convert Sorted Array to BST

Easy

15 mins

Check Permutation

Easy

15 mins

Construct Binary Tree from Inorder and Postorder Traversal

Moderate

25 mins

Count Subarrays with Given XOR

Moderate

15 mins

Flatten A Linked List

Easy

15 mins

Unique Element In Sorted Array

Easy

15 mins

Problem

Submissions

11

Avg. time to solve

15 min

Success Rate

85%

Problem Statement

```
1. Shizuka’s lucky number will surely be present.
2. There will only be a single lucky number.
```

```
The first line of input contains an integer 'T' representing the number of test cases. Then the test cases follow.
The first line of each test case contains a single integer ‘N’, representing the total number of elements present in Shizuka’s list.
The next line contains ‘N’ single-spaced elements, representing the elements of Shizuka’s list
```

```
For each test case, print an integer denoting the lucky number of Shizuka.
The output for each test case will be printed in a separate line.
```

```
1 <= T <= 5
1 <= N <= 10^5
0 <= data <= 10^9
Where ‘data’ is the value of elements of Shizuka’s list.
Time Limit: 1 sec
```

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

```
2
5
1 1 3 5 5
7
2 2 4 4 5 7 7
```

```
3
5
```

```
Test Case 1 :
Given array is [1, 1, 3, 5, 5]
Here, 3 occurs once in the array. So, the answer is 3.
Test Case 2 :
Given array is [2, 2, 4, 4, 5, 7, 7]
Here, 5 occurs once in the array. So, the answer is 5.
```

```
2
5
1 1 4 4 15
7
1 1 2 2 4 6 6
```

```
15
4
```

```
Test Case 1 :
Given array is [1, 1, 4, 4, 15].
Here, 3 occurs once in the array. So, the answer is 3.
Test Case 2 :
Given array is [1, 1, 2, 2, 4, 6, 6]
Here, 4 occurs once in the array. So, the answer is 4.
```

Console

Sample Test Case

Custom Test Case

Download Test Cases

Test Case 1

Test Case 2

Test Case 3

Saving Code...

Full Screen Mode

Change Language

Change Theme

Solution submission not allowed

Save Code

Reset Code