Login

All Problems

Problem title

Difficulty

Avg time to solve

Print Name and age

Easy

--

Chocolate Problem

Moderate

15 mins

Interesting Alphabets

Easy

10 mins

Next Greater Node In Linked List

Easy

20 mins

Two and Four Wheeler Roads

Hard

48 mins

String Maker

Hard

50 mins

Bottom Right View of Binary Tree

Easy

10 mins

Minimum Cost of Reducing Array

Hard

15 mins

Print All Subsets

Easy

20 mins

Strongly Connected Components (Tarjan’s Algorithm)

Hard

15 mins

Problem

Submissions

5

Avg. time to solve

20 min

Success Rate

80%

Problem Statement

```
The first line contains a single integer ‘T’ denoting the number of test cases, then each test case follows
The first line of each test case contains a single integers ‘N’ denoting the length of the array.
The second line of each test case contains ‘N’ integers denoting the array elements.
```

```
For each test case print each subset in a separate line.
The subsets can be print in any order.
Output for each test case will be printed in a separate line.
```

```
1 <= T <= 10
1 <= N <= 10
10^-9 <= arr[i] <= 10^9
Time limit: 1 sec
```

```
2
3
1 2 3
1
10
```

```
1
1 2
1 2 3
1 3
2
2 3
3
10
```

```
For test case 1 :
Total 7 possible subsets can be formed: {1}, {1,2}, {1,2,3}, {1,3}, {2}, {2,3}, {3}
For test case 2 :
Only a single subset {10} is possible for the given input array.
```

```
2
2
1 2
3
1 2 3
```

```
1
1 2
2
1
1 2
1 2 3
1 3
2
2 3
3
```

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