},
{
"cell_type": "code",
- "execution_count": 42,
+ "execution_count": 88,
"metadata": {
"collapsed": false
},
":full_subbags"
]
},
- "execution_count": 42,
+ "execution_count": 88,
"metadata": {},
"output_type": "execute_result"
}
" \n",
" def full_subbags(n)\n",
" return enum_for(:full_subbags, n) unless block_given?\n",
- " self.subbags(n).select {|bags| bags.all? {|b| !b.empty?}}.each do |bs|\n",
+ " self.subbags(n).select {|bags| bags.none? {|b| b.empty?}}.each do |bs|\n",
" yield bs\n",
" end\n",
" end\n",
},
{
"cell_type": "code",
- "execution_count": 34,
+ "execution_count": 89,
"metadata": {
"collapsed": false
},
},
{
"cell_type": "code",
- "execution_count": 35,
+ "execution_count": 90,
"metadata": {
"collapsed": false
},
"[[[1, 2, 3]]]"
]
},
- "execution_count": 35,
+ "execution_count": 90,
"metadata": {},
"output_type": "execute_result"
}
},
{
"cell_type": "code",
- "execution_count": 36,
+ "execution_count": 91,
"metadata": {
"collapsed": false
},
"0..3"
]
},
- "execution_count": 36,
+ "execution_count": 91,
"metadata": {},
"output_type": "execute_result"
}
},
{
"cell_type": "code",
- "execution_count": 37,
+ "execution_count": 92,
"metadata": {
"collapsed": false
},
"[[[], [1, 2, 3]], [[1], [2, 3]], [[2], [1, 3]], [[3], [1, 2]], [[1, 2], [3]], [[1, 3], [2]], [[2, 3], [1]], [[1, 2, 3], []]]"
]
},
- "execution_count": 37,
+ "execution_count": 92,
"metadata": {},
"output_type": "execute_result"
}
},
{
"cell_type": "code",
- "execution_count": 38,
+ "execution_count": 93,
"metadata": {
"collapsed": false
},
"8"
]
},
- "execution_count": 38,
+ "execution_count": 93,
"metadata": {},
"output_type": "execute_result"
}
},
{
"cell_type": "code",
- "execution_count": 39,
+ "execution_count": 94,
"metadata": {
"collapsed": false
},
"[[[], [], [1, 2, 3]], [[], [1], [2, 3]], [[], [2], [1, 3]], [[], [3], [1, 2]], [[], [1, 2], [3]], [[], [1, 3], [2]], [[], [2, 3], [1]], [[], [1, 2, 3], []], [[1], [], [2, 3]], [[1], [2], [3]], [[1], [3], [2]], [[1], [2, 3], []], [[2], [], [1, 3]], [[2], [1], [3]], [[2], [3], [1]], [[2], [1, 3], []], [[3], [], [1, 2]], [[3], [1], [2]], [[3], [2], [1]], [[3], [1, 2], []], [[1, 2], [], [3]], [[1, 2], [3], []], [[1, 3], [], [2]], [[1, 3], [2], []], [[2, 3], [], [1]], [[2, 3], [1], []], [[1, 2, 3], [], []]]"
]
},
- "execution_count": 39,
+ "execution_count": 94,
"metadata": {},
"output_type": "execute_result"
}
},
{
"cell_type": "code",
- "execution_count": 40,
+ "execution_count": 95,
"metadata": {
"collapsed": false
},
"27"
]
},
- "execution_count": 40,
+ "execution_count": 95,
"metadata": {},
"output_type": "execute_result"
}
},
{
"cell_type": "code",
- "execution_count": 41,
+ "execution_count": 96,
"metadata": {
"collapsed": false
},
"0..3"
]
},
- "execution_count": 41,
+ "execution_count": 96,
"metadata": {},
"output_type": "execute_result"
}
},
{
"cell_type": "code",
- "execution_count": 46,
+ "execution_count": 97,
"metadata": {
"collapsed": false
},
"[[[1], [2], [3, 4]], [[1], [3], [2, 4]], [[1], [4], [2, 3]], [[1], [2, 3], [4]], [[1], [2, 4], [3]], [[1], [3, 4], [2]], [[2], [1], [3, 4]], [[2], [3], [1, 4]], [[2], [4], [1, 3]], [[2], [1, 3], [4]], [[2], [1, 4], [3]], [[2], [3, 4], [1]], [[3], [1], [2, 4]], [[3], [2], [1, 4]], [[3], [4], [1, 2]], [[3], [1, 2], [4]], [[3], [1, 4], [2]], [[3], [2, 4], [1]], [[4], [1], [2, 3]], [[4], [2], [1, 3]], [[4], [3], [1, 2]], [[4], [1, 2], [3]], [[4], [1, 3], [2]], [[4], [2, 3], [1]], [[1, 2], [3], [4]], [[1, 2], [4], [3]], [[1, 3], [2], [4]], [[1, 3], [4], [2]], [[1, 4], [2], [3]], [[1, 4], [3], [2]], [[2, 3], [1], [4]], [[2, 3], [4], [1]], [[2, 4], [1], [3]], [[2, 4], [3], [1]], [[3, 4], [1], [2]], [[3, 4], [2], [1]]]"
]
},
- "execution_count": 46,
+ "execution_count": 97,
"metadata": {},
"output_type": "execute_result"
}
},
{
"cell_type": "code",
- "execution_count": 47,
+ "execution_count": 98,
"metadata": {
"collapsed": false
},
"18150"
]
},
- "execution_count": 47,
+ "execution_count": 98,
"metadata": {},
"output_type": "execute_result"
}