7 lines
169 B
Text
7 lines
169 B
Text
function powerset{T}(x::Vector{T})
|
|
result = Vector{T}[[]]
|
|
for elem in x, j in eachindex(result)
|
|
push!(result, [result[j] ; elem])
|
|
end
|
|
result
|
|
end
|