Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/rubyplb.rb

Instance Method Summary collapse

Instance Method Details

#subsetObject



21
22
23
24
25
# File 'lib/rubyplb.rb', line 21

def subset
  (0..self.length).inject([]) do |ret, n|
    ret.push(*self.combination(n))
  end
end