Linux heracles.o2switch.net 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
/
opt
/
alt
/
ruby27
/
share
/
ri
/
system
/
Array
/
//opt/alt/ruby27/share/ri/system/Array/permutation-i.ri
U:RDoc::AnyMethod[iI"permutation:ETI"Array#permutation;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"LWhen invoked with a block, yield all permutations of length +n+ of the ;TI"9elements of the array, then return the array itself.;To:RDoc::Markup::BlankLine o; ; [I"EIf +n+ is not specified, yield all permutations of all elements.;T@o; ; [I"IThe implementation makes no guarantees about the order in which the ;TI"permutations are yielded.;T@o; ; [I"=If no block is given, an Enumerator is returned instead.;T@o; ; [I"Examples:;T@o:RDoc::Markup::Verbatim; [I"a = [1, 2, 3] ;TI"Qa.permutation.to_a #=> [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]] ;TI"-a.permutation(1).to_a #=> [[1],[2],[3]] ;TI"Ea.permutation(2).to_a #=> [[1,2],[1,3],[2,1],[2,3],[3,1],[3,2]] ;TI"Qa.permutation(3).to_a #=> [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]] ;TI"Ba.permutation(0).to_a #=> [[]] # one permutation of length 0 ;TI"Aa.permutation(4).to_a #=> [] # no permutations of length 4;T:@format0: @fileI"array.c;T:0@omit_headings_from_table_of_contents_below0I"�ary.permutation {|p| block} -> ary ary.permutation -> Enumerator ary.permutation(n) {|p| block} -> ary ary.permutation(n) -> Enumerator ;T0[ I"(*args);T@&FI" Array;TcRDoc::NormalClass00