650. Subsets
0
Medium
Given an integer array arr of unique elements, return all possible subsets (the power set).
The solution set must not contain duplicate subsets.Print the solution in sorted order.
Note: Please watch the output format once before submitting.
The solution set must not contain duplicate subsets.Print the solution in sorted order.
Note: Please watch the output format once before submitting.
Input Format
First line takes an integer N(size of array)
Second Line contains N space separated integers describing array
Output Format
Print all possible subsets, Each subset is in new line and all subsets must be in sorted order.
Example
Input
3
25 4 7
Output
4
4 7
7
25
25 4
25 4 7
25 7
Constraints
1 <= N <= 10
-100 <= arr[i] <= 100
All arr[i] must be unique element.
-100 <= arr[i] <= 100
All arr[i] must be unique element.
Loading...
View Submissions
Console