- 1
Challenge : Find the Power set of the given set without using loops
use map, reduce, lambda, filter
2 Antworten
+ 4
Please give an example of the expected output for a given input.
- 1
input : {1,2,3}
output : { {}, {1}, {2}, {3}, {1,2}, {1,3}, {2,3}, {1,2,3} }
If given set has n elements than its Power set will have 2^n elements
In given Example given set has 3 elements so its Power set has 2^3= 8 elements