Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
9
Task/Power-set/E/power-set.e
Normal file
9
Task/Power-set/E/power-set.e
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
pragma.enable("accumulator")
|
||||
|
||||
def powerset(s) {
|
||||
return accum [].asSet() for k in 0..!2**s.size() {
|
||||
_.with(accum [].asSet() for i ? ((2**i & k) > 0) => elem in s {
|
||||
_.with(elem)
|
||||
})
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue