#### Possible subsets of a set of distinct integers

This problem asks us to return all possible subsets of a given set of distinct integers. For example, if the input is [1,2,3], then the output should be all possible subsets of those integers: , [1,2], [1,2,3], [1,3], , [2,3], and .

#### Problem

```Given a set of distinct integers, return all possible subsets.
Input: [1,2,3]
Output:
[
,
[1,2],
[1,2,3],
[1,3],
,
[2,3],
,
]```

#### Solution

This solution is in C#. Our A.I. can create solutions in multiple languages.
```using System;
using System.Collections.Generic;

namespace InterviewPreperationGuide.Core.CrackingTheCodingInterview.c16q8 {
public class Solution {
public void Init () {
Console.WriteLine ();
}

// Time: O (2^n)
// Space: O (n)
public List<List<int>> GetSubsets (List<int> set, int index) {
List<List<int>> allSubsets = null;

if (set.Count == index) {
allSubsets = new List<List<int>> ();
} else {
allSubsets = GetSubsets (set, index + 1);
int item = set[index];
List<List<int>> moreSubsets = new List<List<int>> ();

foreach (List<int> subset in allSubsets) {
List<int> newSubset = new List<int> ();
}