      "* Else\n",
      "    * Return False\n",
      "\n",
      "Notes:\n",
      "* Since the characters are in ASCII, we could potentially use an array of size 128 (or 256 for extended ASCII)\n",
      "* Instead of using two hash maps, you could use one hash map and increment character values based on the first string and decrement based on the second string\n",
      "* You can short circuit if the lengths of each string are not equal, len() in Python is generally O(1)\n",
      "\n",
      "Complexity:\n",
      "* Time: O(n)\n",
 
</s> remove     "* Is the string ASCII (extended)?  Or Unicode?\n",
    "    * ASCII extended, which is 256 characters\n",
 </s> add     "*Problem statements are sometimes intentionally ambiguous.  Asking clarifying questions, identifying constraints, and stating assumptions help to ensure you code the intended solution.*\n",
    "\n",
    "* Can I assume the string is ASCII?\n",
    "    * Yes\n",
    "    * Note: Unicode strings could require special handling depending on your language\n", </s> remove     "    return unique_counts1 == unique_counts2\n",
 </s> add     "    return unique_counts1 == unique_counts2"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Unit Test"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Success: test_permutation\n",
      "Success: test_permutation\n"
     ]
    }
   ],
   "source": [
    "from nose.tools import assert_equal\n", </s> remove     "run_tests(permutations_alt)"
 </s> add     "class Test(object):\n",
    "    def test_permutation(self, func):\n",
    "        assert_equal(func('', 'foo'), False)\n",
    "        assert_equal(func('Nib', 'bin'), False)\n",
    "        assert_equal(func('act', 'cat'), True)\n",
    "        assert_equal(func('a ct', 'ca t'), True)\n",
    "        print('Success: test_permutation')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    test.test_permutation(permutations)\n",
    "    test.test_permutation(permutations_alt)" </s> remove   {
   "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_permutation(self, func):\n",
    "        assert_equal(func('', 'foo'), False)\n",
    "        assert_equal(func('Nib', 'bin'), False)\n",
    "        assert_equal(func('act', 'cat'), True)\n",
    "        assert_equal(func('a ct', 'ca t'), True)\n",
    "\n",
    "def run_tests(func):\n",
    "    test = Test()\n",
    "    test.test_permutation(func)"
   ]
  },
 </s> add 
    "* Since the characters are in ASCII, we could potentially use an array of size 128 (or 256 for extended ASCII), where each array index is equivalent to an ASCII value\n",
      "* Else\n",
      "    * Return False\n",
      "\n",
      "Notes:\n",
    "* Since the characters are in ASCII, we could potentially use an array of size 128 (or 256 for extended ASCII), where each array index is equivalent to an ASCII value\n",
      "* Instead of using two hash maps, you could use one hash map and increment character values based on the first string and decrement based on the second string\n",
      "* You can short circuit if the lengths of each string are not equal, len() in Python is generally O(1)\n",
      "\n",
      "Complexity:\n",
      "* Time: O(n)\n",
keep keep keep keep replace keep keep keep keep keep
 Reworked notebook: Added more detail to clarifying questions and test cases.  Reworked algorithm discussion and unit test. 
arrays-strings/permutation.ipynb