    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "## Algorithm\n",
      "\n",
      "We'll keep a hash map (set) to keep track of unique characters we encounter.  \n",
      "\n",
      "Note:\n",
      "* We could also use a dictionary, but it seems more logical to use a set as it does not contain duplicate elements.\n",
      "* Since the characters are in ASCII, we could potentially use an array of size 128 (or 256 for extended ASCII)\n",
      "\n",
 
</s> remove     "Note:\n",
    "* We could also use a dictionary, but it seems more logical to use a set as it does not contain duplicate elements.\n",
    "* Since the characters are in ASCII, we could potentially use an array of size 128 (or 256 for extended ASCII)\n",
    "\n",
    "Steps:\n",
    "* Scan each character.\n",
    "* For each character:\n",
    "    * If the character does not exist in a hash map, add the character to a hash map.\n",
    "    * Else, return False.\n",
    "* Return True\n",
 </s> add     "A set is an unordered collection of unique elements.  \n", </s> remove     "Algorithm Complexity:\n",
    "* Time: O(n^2).\n",
    "* Space: In-place."
 </s> add     "Notes:\n",
    "* We could also use a dictionary, but it seems more logical to use a set as it does not contain duplicate elements\n",
    "* Since the characters are in ASCII, we could potentially use an array of size 128 (or 256 for extended ASCII)\n",
    "\n",
    "Complexity:\n",
    "* Time: O(n)\n",
    "* Space: Additional O(m), where m is the number of unique characters in the hash map" </s> remove     "Since we cannot use additional data structures, this will eliminate the fast lookup O(1) time provided by our hash map.\n",
    "* Scan each character.\n",
 </s> add     "We'll keep a hash map (set) to keep track of unique characters we encounter.  \n",
    "\n",
    "Steps:\n",
    "* Scan each character\n", </s> remove     "## Problem: Implement an algorithm to determine if a string has all unique characters"
 </s> add     "## Problem: Implement an algorithm to determine if a string has all unique characters\n",
    "\n",
    "* [Clarifying Questions](#Clarifying-Questions)\n",
    "* [Test Cases](#Test-Cases)\n",
    "* [Algorithm 1: Sets and Length Comparison](#Algorithm-1:-Sets-and-Length-Comparison)\n",
    "* [Code: Sets and Length Comparison](#Code:-Sets-and-Length-Comparison)\n",
    "* [Algorithm 2: Hash Map Lookup](#Algorithm-2:-Hash-Map-Lookup)\n",
    "* [Code: Hash Map Lookup](#Code:-Hash-Map-Lookup)\n",
    "* [Algorithm 3: In-Place](#Algorithm-3:-In-Place)\n",
    "* [Code: In-Place](#Code:-In-Place)" </s> remove     "    * Scan all [other] characters in the array\n",
    "        * Exluding the current character from the scan is rather tricky in Python and results in a non-Pythonic solution\n",
    "        * If there is a match, return False\n",
 </s> add     "    * If the character does not exist in a hash map, add the character to a hash map\n",
    "    * Else, return False\n",
    "## Algorithm 1: Sets and Length Comparison\n",
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
    "## Algorithm 1: Sets and Length Comparison\n",
    "## Algorithm 1: Sets and Length Comparison\n",
    "## Algorithm 1: Sets and Length Comparison\n",
      "\n",
      "Note:\n",
      "* We could also use a dictionary, but it seems more logical to use a set as it does not contain duplicate elements.\n",
      "* Since the characters are in ASCII, we could potentially use an array of size 128 (or 256 for extended ASCII)\n",
      "\n",
keep keep keep keep replace replace replace keep keep keep keep keep
 Reworked algorithm descriptions.  Added notebook index.  Minor cleanup. 
arrays-strings/unique_chars.ipynb