day 8 - question
Eigth Question - Coding
This is similar to week 1 questions, but with a twist. Let’s say that we have a set/list of numbers. Determine all subsets of that list of numbers. For example, let’s say we have
L = [1,2,3]
Then, all the subsets are:
S = [[], [1], [2], [3], [1, 2], [1, 3],
[2, 1], [2, 3], [1,2,3]]
Write the function subsets
so that:
S = subsets(L)