      "* 'ABC' -> 'ABC'\n",
      "* 'AAABCCDDDD' -> 'A3B1C2D4'"
     ]
    },
    {
     "cell_type": "code",
     "execution_count": null,
     "metadata": {
      "collapsed": true
     },
     "outputs": [],
     "source": [
      "from nose.tools import assert_equal\n",
      "\n",
      "class Test(object):\n",
      "    def test_compress(self, func):\n",
      "        assert_equal(func(None), None)\n",
      "        assert_equal(func(''), '')\n",
      "        assert_equal(func('ABC'), 'ABC')\n",
      "        assert_equal(func('AAABCCDDDD'), 'A3B1C2D4')\n",
      "\n",
      "def run_tests(func):\n",
      "    test = Test()\n",
      "    test.test_compress(func)"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "## Algorithm: List\n",
 
</s> remove     "run_tests(compress_string_alt)"
 </s> add     "class Test(object):\n",
    "    def test_compress(self, func):\n",
    "        assert_equal(func(None), None)\n",
    "        assert_equal(func(''), '')\n",
    "        assert_equal(func('ABC'), 'ABC')\n",
    "        assert_equal(func('AAABCCDDDD'), 'A3B1C2D4')\n",
    "        print('Success: test_compress')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    test.test_compress(compress_string)\n",
    "    test.test_compress(compress_string_alt)" </s> remove     "    compressed_string[pos + 1] = ord(str(count))\n",
    "    return compressed_string\n",
 </s> add     "    compressed_string[pos+1] = ord(str(count))\n",
    "    return compressed_string"
   ]
  },
  {
   "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_compress\n",
      "Success: test_compress\n"
     ]
    }
   ],
   "source": [
    "from nose.tools import assert_equal\n", </s> remove    "execution_count": null,
 </s> add    "execution_count": 2, </s> remove    "execution_count": null,
 </s> add    "execution_count": 1,
      "* 'ABC' -> 'ABC'\n",
      "* 'AAABCCDDDD' -> 'A3B1C2D4'"
     ]
    },






















    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "## Algorithm: List\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, code, and unit test. 
arrays-strings/compress.ipynb