Ruby/Array/combination
Материал из Wiki.crossplatform.ru
Версия от 17:10, 26 мая 2010; (Обсуждение)
Iterate all possible 2-element subsets (order does not matter)
a = [1,2,3] a.rubination(2) {|x| print x } # Prints "[1, 2][1, 3][2, 3]"
Личные инструменты |
ПросмотрыRuby/Array/combinationМатериал из Wiki.crossplatform.ruВерсия от 17:10, 26 мая 2010; (Обсуждение)
Iterate all possible 2-element subsets (order does not matter)a = [1,2,3] a.rubination(2) {|x| print x } # Prints "[1, 2][1, 3][2, 3]" |