Question
Find power set

You are given an integer array nums containing distinct elements.

A subset of an array is any combination of its elements (including the empty set and the array itself).

The power set of an array is the set of all possible subsets.

Your task is to generate and return the power set of nums.

The solution set must not contain duplicate subsets, and the order of subsets does not matter.

Input
User Task
This is a function problem. You don't have to take any input. You are required to complete the function findSubsets() which takes an array nums as parameter.

Custom Input (For Non Functional Language)
The first line will take a single integer n.
The second line will take n space-separated integers representing elements of the nums array.
Output
Return all possible subsets (the power set). (Return list of subsets).
Example
Input
3
-10 5 -6
Output
[[], [-10], [5], [-10, 5], [-6], [-10, -6], [5, -6], [-10, 5, -6]]


Input
1
0
Output
[[], [0]]

Online