      "collapsed": false
     },
     "outputs": [],
     "source": [
      "def max_xor(lower, upper):\n",
      "    result = 0\n",
      "    for l in range(lower, upper + 1):\n",
      "        for u in range(lower, upper + 1):\n",
      "            curr = l ^ u\n",
      "            if result < curr:\n",
      "                result = curr\n",
      "    return result"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
 
</s> remove     "def max_xor(lower, upper):\n",
    "    # TODO: Implement me\n",
    "    pass"
 </s> add     "class Solution(object):\n",
    "\n",
    "    def max_xor(self, lower, upper):\n",
    "        # TODO: Implement me\n",
    "        pass" </s> remove     "        assert_equal(max_xor(10, 15), 7)\n",
 </s> add     "        solution = Solution()\n",
    "        assert_equal(solution.max_xor(10, 15), 7)\n", </s> remove     "        assert_equal(max_xor(10, 15), 7)\n",
 </s> add     "        solution = Solution()\n",
    "        assert_equal(solution.max_xor(10, 15), 7)\n", </s> remove         assert_equal(max_xor(10, 15), 7)
 </s> add         solution = Solution()
        assert_equal(solution.max_xor(10, 15), 7) </s> remove     "version": 2
 </s> add     "version": 3
    "class Solution(object):\n",
    "\n",
    "    def max_xor(self, lower, upper):\n",
    "        result = 0\n",
    "        for l in range(lower, upper + 1):\n",
    "            for u in range(lower, upper + 1):\n",
    "                curr = l ^ u\n",
    "                if result < curr:\n",
    "                    result = curr\n",
    "        return result"
      "collapsed": false
     },
     "outputs": [],
     "source": [
    "class Solution(object):\n",
    "\n",
    "    def max_xor(self, lower, upper):\n",
    "        result = 0\n",
    "        for l in range(lower, upper + 1):\n",
    "            for u in range(lower, upper + 1):\n",
    "                curr = l ^ u\n",
    "                if result < curr:\n",
    "                    result = curr\n",
    "        return result"
    "class Solution(object):\n",
    "\n",
    "    def max_xor(self, lower, upper):\n",
    "        result = 0\n",
    "        for l in range(lower, upper + 1):\n",
    "            for u in range(lower, upper + 1):\n",
    "                curr = l ^ u\n",
    "                if result < curr:\n",
    "                    result = curr\n",
    "        return result"
    "class Solution(object):\n",
    "\n",
    "    def max_xor(self, lower, upper):\n",
    "        result = 0\n",
    "        for l in range(lower, upper + 1):\n",
    "            for u in range(lower, upper + 1):\n",
    "                curr = l ^ u\n",
    "                if result < curr:\n",
    "                    result = curr\n",
    "        return result"
    "class Solution(object):\n",
    "\n",
    "    def max_xor(self, lower, upper):\n",
    "        result = 0\n",
    "        for l in range(lower, upper + 1):\n",
    "            for u in range(lower, upper + 1):\n",
    "                curr = l ^ u\n",
    "                if result < curr:\n",
    "                    result = curr\n",
    "        return result"
    "class Solution(object):\n",
    "\n",
    "    def max_xor(self, lower, upper):\n",
    "        result = 0\n",
    "        for l in range(lower, upper + 1):\n",
    "            for u in range(lower, upper + 1):\n",
    "                curr = l ^ u\n",
    "                if result < curr:\n",
    "                    result = curr\n",
    "        return result"
    "class Solution(object):\n",
    "\n",
    "    def max_xor(self, lower, upper):\n",
    "        result = 0\n",
    "        for l in range(lower, upper + 1):\n",
    "            for u in range(lower, upper + 1):\n",
    "                curr = l ^ u\n",
    "                if result < curr:\n",
    "                    result = curr\n",
    "        return result"
    "class Solution(object):\n",
    "\n",
    "    def max_xor(self, lower, upper):\n",
    "        result = 0\n",
    "        for l in range(lower, upper + 1):\n",
    "            for u in range(lower, upper + 1):\n",
    "                curr = l ^ u\n",
    "                if result < curr:\n",
    "                    result = curr\n",
    "        return result"
    "class Solution(object):\n",
    "\n",
    "    def max_xor(self, lower, upper):\n",
    "        result = 0\n",
    "        for l in range(lower, upper + 1):\n",
    "            for u in range(lower, upper + 1):\n",
    "                curr = l ^ u\n",
    "                if result < curr:\n",
    "                    result = curr\n",
    "        return result"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
keep keep keep keep replace replace replace replace replace replace replace replace keep keep keep keep keep
 Move xor challenge solution to a class (#143) 
online_judges/maximizing_xor/maximizing_xor_solution.ipynb