      "            l += 1\n",
      "        else:\n",
      "            result.append(right[r])\n",
      "            r += 1\n",
      "            \n",
      "    # Copy remaining elements\n",
      "    while l < len(left):\n",
      "        result.append(left[l])\n",
      "        l += 1\n",
      "    while r < len(right):\n",
      "        result.append(right[r])\n",
      "        r += 1\n",
      "    return result\n",
      "\n",
      "\n",
      "def merge_sort(data):\n",
      "    if data is None or len(data) < 2:\n",
      "        return data\n",
      "    mid = len(data) // 2\n",
      "    left = data[:mid]\n",
      "    right = data[mid:]\n",
      "    left = merge_sort(left)\n",
      "    right = merge_sort(right)\n",
      "    return merge(left, right)"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
 
</s> remove     "def merge(left, right):\n",
    "    l = 0\n",
    "    r = 0\n",
    "    result = []\n",
    "    while l < len(left) and r < len(right):\n",
    "        if left[l] < right[r]:\n",
 </s> add     "class MergeSort(object):\n",
    "\n",
    "    def sort(self, data):\n",
    "        if data is None:\n",
    "            raise TypeError('data cannot be None')\n",
    "        return self._sort(data)\n",
    "\n",
    "    def _sort(self, data):\n",
    "        if len(data) < 2:\n",
    "            return data\n",
    "        mid = len(data) // 2\n",
    "        left = data[:mid]\n",
    "        right = data[mid:]\n",
    "        left = self._sort(left)\n",
    "        right = self._sort(right)\n",
    "        return self._merge(left, right)\n",
    "\n",
    "    def _merge(self, left, right):\n",
    "        l = 0\n",
    "        r = 0\n",
    "        result = []\n",
    "        while l < len(left) and r < len(right):\n",
    "            if left[l] < right[r]:\n",
    "                result.append(left[l])\n",
    "                l += 1\n",
    "            else:\n",
    "                result.append(right[r])\n",
    "                r += 1\n",
    "        # Copy remaining elements\n",
    "        while l < len(left):\n", </s> remove     "        else:\n",
 </s> add     "        while r < len(right):\n", </s> remove     "def merge_sort(data):\n",
    "    # TODO: Implement me\n",
    "    pass"
 </s> add     "class MergeSort(object):\n",
    "\n",
    "    def sort(self, data):\n",
    "        # TODO: Implement me\n",
    "        pass" </s> remove     "        data = []\n",
    "        sorted_data = merge_sort(data)\n",
    "        assert_equal(sorted_data, [])\n",
 </s> add     "        assert_equal(merge_sort.sort([]), [])\n", </s> remove     "        data = []\n",
    "        sorted_data = merge_sort(data)\n",
    "        assert_equal(sorted_data, [])\n",
 </s> add     "        assert_equal(merge_sort.sort([]), [])\n",
    "        return result"
      "            l += 1\n",
      "        else:\n",
      "            result.append(right[r])\n",
      "            r += 1\n",
    "        return result"
    "        return result"
    "        return result"
    "        return result"
    "        return result"
    "        return result"
    "        return result"
    "        return result"
    "        return result"
    "        return result"
    "        return result"
    "        return result"
    "        return result"
    "        return result"
    "        return result"
    "        return result"
    "        return result"
    "        return result"
    "        return result"
    "        return result"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
keep keep keep keep 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
 Update merge sort challenge (#130)

Update constraints, test cases, code, and tests. 
sorting_searching/merge_sort/merge_sort_solution.ipynb