Login

All Problems

Problem title

Difficulty

Avg time to solve

N-th Fibonacci Number

Moderate

40 mins

Product Of Array Except Self

Easy

26 mins

Search In Rotated Sorted Array

Moderate

30 mins

K Largest Element

Moderate

10 mins

Subset OR

Moderate

20 mins

Two Sum

Easy

10 mins

Average Marks

Easy

5 mins

Count all sub-arrays having sum divisible by k

Moderate

15 mins

Find Unique

Easy

--

Order of People Heights

Ninja

45 mins

Problem

Submissions

72

Avg. time to solve

20 min

Success Rate

80%

Problem Statement

```
Input : arr[] = {5, 1, 3, 4, 2}
Output : 2
7 is the maximum value possible of OR,
5|2 = 7 and 5|3 = 7
```

```
The first line contains a single integer ‘T’ representing the number of test cases.Then ‘T’ test cases follow.
The first line of each test case contains the integer ‘N’ representing the size of the input ‘ARR’.
The next line of each test case contains ‘N’ single space-separated integers that represent the elements of the ‘ARR’.
```

```
For each test case, return an integer denoting the size of the smallest subset with maximum possible OR.
Output for each test case will be printed in a separate line.
```

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

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

```
1
6
2 6 2 8 4 5
```

```
3
```

```
15 is the maximum value of OR and set elements are 8, 6, and 5.
```

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

```
2
```

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