     "source": [
      "class ReverseStringAlt(object):\n",
      "\n",
      "    def reverse_string_alt(string):\n",
      "        if string is None or not string:\n",
      "            return string\n",
      "        return string[::-1]\n",
      "\n",
      "    def reverse_string_alt2(string):\n",
      "        if string is None or not string:\n",
      "            return string\n",
      "        return ''.join(reversed(string))"
 
</s> remove     "        if string is None or not string:\n",
    "            return string\n",
    "        return ''.join(reversed(string))"
 </s> add     "        if string:\n",
    "            return ''.join(reversed(string))\n",
    "        return string" </s> remove     "        if chars is None or not chars:\n",
    "            return chars\n",
    "        size = len(chars)\n",
    "        for i in range(size // 2):\n",
    "            chars[i], chars[size - 1 - i] = \\\n",
    "                chars[size - 1 - i], chars[i]\n",
 </s> add     "        if chars:\n",
    "            size = len(chars)\n",
    "            for i in range(size // 2):\n",
    "                chars[i], chars[size - 1 - i] = \\\n",
    "                    chars[size - 1 - i], chars[i]\n", </s> remove     "    * Swap i and len(string) - 1 - i\n",
 </s> add     "    * Swap char with index (i) and char with index (len(string) - 1 - i)\n",
    "        if string:\n",
    "            return string[::-1]\n",
    "        return string\n",
     "source": [
      "class ReverseStringAlt(object):\n",
      "\n",
      "    def reverse_string_alt(string):\n",
    "        if string:\n",
    "            return string[::-1]\n",
    "        return string\n",
    "        if string:\n",
    "            return string[::-1]\n",
    "        return string\n",
    "        if string:\n",
    "            return string[::-1]\n",
    "        return string\n",
      "\n",
      "    def reverse_string_alt2(string):\n",
      "        if string is None or not string:\n",
      "            return string\n",
      "        return ''.join(reversed(string))"
keep keep keep keep replace replace replace keep keep keep keep keep
 Simplify reverse string code, improve algorithm readability (#183) 
arrays_strings/reverse_string/reverse_string_solution.ipynb