      "* 'act', 'cat' -> True\n",
      "* 'a ct', 'ca t' -> True"
     ]
    },
    {
     "cell_type": "code",
     "execution_count": null,
     "metadata": {
      "collapsed": false
     },
     "outputs": [],
     "source": [
      "from nose.tools import assert_equal\n",
      "\n",
      "class Test(object):\n",
      "    def test_permutation(self, func):\n",
      "        assert_equal(func('', 'foo'), False)\n",
      "        assert_equal(func('Nib', 'bin'), False)\n",
      "        assert_equal(func('act', 'cat'), True)\n",
      "        assert_equal(func('a ct', 'ca t'), True)\n",
      "\n",
      "def run_tests(func):\n",
      "    test = Test()\n",
      "    test.test_permutation(func)"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "## Algorithm: Compare Sorted Strings\n",
 
</s> remove     "run_tests(permutations_alt)"
 </s> add     "class Test(object):\n",
    "    def test_permutation(self, func):\n",
    "        assert_equal(func('', 'foo'), False)\n",
    "        assert_equal(func('Nib', 'bin'), False)\n",
    "        assert_equal(func('act', 'cat'), True)\n",
    "        assert_equal(func('a ct', 'ca t'), True)\n",
    "        print('Success: test_permutation')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    test.test_permutation(permutations)\n",
    "    test.test_permutation(permutations_alt)" </s> remove     "    return unique_counts1 == unique_counts2\n",
 </s> add     "    return unique_counts1 == unique_counts2"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Unit Test"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Success: test_permutation\n",
      "Success: test_permutation\n"
     ]
    }
   ],
   "source": [
    "from nose.tools import assert_equal\n", </s> remove     "    return sorted(str1) == sorted(str2)\n",
    "\n",
    "run_tests(permutations)"
 </s> add     "    return sorted(str1) == sorted(str2)" </s> remove    "execution_count": null,
 </s> add    "execution_count": 2,
      "* 'act', 'cat' -> True\n",
      "* 'a ct', 'ca t' -> True"
     ]
    },






















    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "## Algorithm: Compare Sorted Strings\n",
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 Reworked notebook: Added more detail to clarifying questions and test cases.  Reworked algorithm discussion and unit test. 
arrays-strings/permutation.ipynb