      "## Algorithm: List\n",
      "\n",
      "![alt text](https://raw.githubusercontent.com/donnemartin/algorithms-data-structures/master/images/compress_string.jpg)\n",
      "\n",
      "Since Python strings are immutable, we'll use a list of characters to exercise string manipulation.  Note using a list vs a bytearray will will result in additional space to create the list and to convert the list to a string.\n",
      "\n",
      "* If string is empty return string\n",
      "* count = 0\n",
      "* size = 0\n",
      "* last_char = first char in string\n",
 
</s> remove     "![alt text](https://raw.githubusercontent.com/donnemartin/algorithms-data-structures/master/images/compress_string.jpg)\n",
 </s> add     "Since Python strings are immutable, we'll use a list of characters instead to exercise in-place string manipulation as you would get with a C string (which is null terminated, as seen in the diagram below).  Python does not use a null-terminator.\n", </s> remove     "* If string is empty return string\n",
    "* count = 0\n",
    "* size = 0\n",
    "* last_char = first char in string\n",
    "* For each char in string\n",
    "    * If char == last_char\n",
    "        count++\n",
    "    * Else\n",
    "        size += 2\n",
    "        count++\n",
    "        last_char = char\n",
    "* size += 2\n",
 </s> add     "* Calculate the size of the compressed string\n", </s> remove     "![alt text](https://raw.githubusercontent.com/donnemartin/algorithms-data-structures/master/images/compress_string.jpg)\n",
    "\n",
    "Since Python strings are immutable, we'll use a bytearray to exercise array manipulation.  As seen above, we could use a list of characters to create the compressed string then convert it to a string in the end, but this will result in additional space.\n",
    "\n",
    "The algorithm is the same, except we will need to work with the bytearray's character codes instead of the characters as we did above when we implemented this solution with a list.\n",
 </s> add     "The byte array algorithm similar when using a list, except we will need to work with the bytearray's character codes instead of the characters as we did above when we implemented this solution with a list.\n", </s> remove     "        * append count to compressed_string\n",
    "        * count = 1\n",
    "        * last_char = char\n",
    "    * Append last_char to compressed_string\n",
    "    * append count to compressed_string\n",
    "* return compressed_string\n",
 </s> add     "        * Append count to compressed_string\n",
    "    * Return compressed_string\n",
    "![alt text](https://raw.githubusercontent.com/donnemartin/algorithms-data-structures/master/images/compress_string.jpg)\n",
      "## Algorithm: List\n",
      "\n",
      "![alt text](https://raw.githubusercontent.com/donnemartin/algorithms-data-structures/master/images/compress_string.jpg)\n",
      "\n",
    "![alt text](https://raw.githubusercontent.com/donnemartin/algorithms-data-structures/master/images/compress_string.jpg)\n",
      "\n",
      "* If string is empty return string\n",
      "* count = 0\n",
      "* size = 0\n",
      "* last_char = first char in string\n",
keep keep keep keep 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