      "            last_char_code = char_code\n",
      "    size += 2\n",
      "    if size >= len(string):\n",
      "        return string\n",
      "    \n",
      "    # Create compressed_string\n",
      "    compressed_string = bytearray(size)\n",
      "    pos = 0\n",
 
</s> remove     "            count = 1\n",
 </s> add  </s> remove     "        if char_code == last_char_code:\n",
    "            count += 1\n",
    "        else:\n",
 </s> add     "        if char_code != last_char_code:\n",
    "    \n",
    "    # If the compressed string size is greater than \n",
    "    # or equal to string size, return string    \n",
      "            last_char_code = char_code\n",
      "    size += 2\n",
    "    \n",
    "    # If the compressed string size is greater than \n",
    "    # or equal to string size, return string    \n",
      "    if size >= len(string):\n",
      "        return string\n",
      "    \n",
      "    # Create compressed_string\n",
      "    compressed_string = bytearray(size)\n",
      "    pos = 0\n",
keep add keep 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