      "collapsed": false
     },
     "outputs": [],
     "source": [
      "def unique_chars_alt(string):\n",
      "    for char in string:\n",
      "        if string.count(char) > 1:\n",
      "            return False\n",
      "    return True\n",
      "\n",
 
</s> remove     "def unique_chars_alt(string):\n",
 </s> add     "def unique_chars_hash(string):\n", </s> remove     "    return len(set(string)) == len(string)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "from nose.tools import assert_equal\n",
    "\n",
    "class Test(object):\n",
    "  def test_unique_chars(self):\n",
    "        assert_equal(unique_chars(''), True)\n",
    "        assert_equal(unique_chars('foo'), False)\n",
    "        assert_equal(unique_chars('bar'), True)    \n",
    "\n",
    "def run_tests():\n",
    "    test = Test()\n",
    "    test.test_unique_chars()\n",
 </s> add     "    return len(set(string)) == len(string)\n", </s> remove     "run_tests()"
 </s> add     "run_tests(unique_chars_hash)" </s> remove     "run_tests()"
 </s> add     "run_tests(unique_chars)"
    "def unique_chars_inplace(string):\n",
      "collapsed": false
     },
     "outputs": [],
     "source": [
    "def unique_chars_inplace(string):\n",
      "    for char in string:\n",
      "        if string.count(char) > 1:\n",
      "            return False\n",
      "    return True\n",
      "\n",
keep keep keep keep replace keep keep keep keep keep
 Moved unit test to test case section.  Updated unit test to take a function parameter on which to run the test. 
arrays-strings/unique_chars.ipynb