mirror of
https://github.com/donnemartin/interactive-coding-challenges
synced 2026-01-05 08:58:02 +00:00
@@ -91,9 +91,7 @@
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"class Sets(object):\n",
|
||||
@@ -124,16 +122,14 @@
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# %load test_power_set.py\n",
|
||||
"from nose.tools import assert_equal\n",
|
||||
"import unittest\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"class TestPowerSet(object):\n",
|
||||
"class TestPowerSet(unittest.TestCase):\n",
|
||||
"\n",
|
||||
" def test_power_set(self):\n",
|
||||
" input_set = []\n",
|
||||
@@ -154,9 +150,9 @@
|
||||
" def run_test(self, input_set, expected):\n",
|
||||
" combinatoric = Combinatoric()\n",
|
||||
" result = combinatoric.find_power_set_recursive(input_set)\n",
|
||||
" assert_equal(result, expected)\n",
|
||||
" self.assertEqual(result, expected)\n",
|
||||
" result = combinatoric.find_power_set_iterative(input_set)\n",
|
||||
" assert_equal(result, expected)\n",
|
||||
" self.assertEqual(result, expected)\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"def main():\n",
|
||||
@@ -194,9 +190,9 @@
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.5.0"
|
||||
"version": "3.7.2"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
"nbformat_minor": 1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user