      "    def test_compress(self, func):\n",
      "        assert_equal(func(None), None)\n",
      "        assert_equal(func(''), '')\n",
      "        assert_equal(func('AABBCC'), 'AABBCC')\n",
      "        assert_equal(func('AAABCCDDDD'), 'A3B1C2D4')\n",
      "        print('Success: test_compress')\n",
      "\n",
      "\n",
      "def main():\n",
      "    test = TestCompress()\n",
 
</s> remove     "            result += prev_char + str(count)\n",
 </s> add     "            result += prev_char + (str(count) if count > 1 else '')\n", </s> remove         assert_equal(func('AAABCCDDDD'), 'A3B1C2D4')
 </s> add         assert_equal(func('AAABCCDDDD'), 'A3BC2D4') </s> remove     "* 'AAABCCDDDD' -> 'A3B1C2D4'"
 </s> add     "* 'AAABCCDDDD' -> 'A3BC2D4'" </s> remove     "## Problem: Compress a string such that 'AAABCCDDDD' becomes 'A3B1C2D4'.  Only compress the string if it saves space.\n",
 </s> add     "## Problem: Compress a string such that 'AAABCCDDDD' becomes 'A3BC2D4'.  Only compress the string if it saves space.\n",
    "        assert_equal(func('AAABCCDDDD'), 'A3BC2D4')\n",
      "    def test_compress(self, func):\n",
      "        assert_equal(func(None), None)\n",
      "        assert_equal(func(''), '')\n",
      "        assert_equal(func('AABBCC'), 'AABBCC')\n",
    "        assert_equal(func('AAABCCDDDD'), 'A3BC2D4')\n",
      "        print('Success: test_compress')\n",
      "\n",
      "\n",
      "def main():\n",
      "    test = TestCompress()\n",
keep keep keep keep replace keep keep keep keep keep
 Update compress solution so AAAAB becomes A4B.

Previously the solution would yield A4B1, which doesn't have as much compression. 
arrays_strings/compress/compress_solution.ipynb