#### All possible subsets of distinct integers

This problem involves finding all possible subsets of distinct integers. The solution set must not contain duplicate subsets, and the elements in each subset must be in non-descending order.

#### Problem

```Given a set of distinct integers, return all possible subsets.
Note:
Elements in a subset must be in non-descending order.
The solution set must not contain duplicate subsets.
For example,
If nums = [1,2,3], a solution is:
[
,
,
,
[1,2,3],
[1,3],
[2,3],
[1,2],
[]
]```

#### Solution

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

namespace InterviewPrepQuestions.Backtracking
{
class Subsets
{
public IList<IList<int>> SubsetsWithDup(int[] nums)
{
IList<IList<int>> result = new List<IList<int>>();
Array.Sort(nums);
Backtrack(result, new List<int>(), nums, 0);
return result;
}

private void Backtrack(IList<IList<int>> result, List<int> tempList, int[] nums, int start)
{
for(int i = start; i < nums.Length; i++)
{
if (i > start && nums[i] == nums[i - 1]) continue; // skip duplicates