       "output_type": "stream",
       "text": [
        "Success: test_permutation\n"
       ]
      }
     ],
     "source": [
      "run -i test_permutation_solution.py"
 
</s> remove    "version": "3.4.3"
 </s> add    "version": "3.5.0" </s> remove     "def permutations(str1, str2):\n",
    "    # TODO: Implement me\n",
    "    pass"
 </s> add     "class Permutations(object):\n",
    "\n",
    "    def is_permutation(self, str1, str2):\n",
    "        # TODO: Implement me\n",
    "        pass" </s> remove     "def permutations(str1, str2):\n",
    "    if str1 is None or str2 is None:\n",
    "        return False\n",
    "    return sorted(str1) == sorted(str2)"
 </s> add     "class Permutations(object):\n",
    "\n",
    "    def is_permutation(self, str1, str2):\n",
    "        if str1 is None or str2 is None:\n",
    "            return False\n",
    "        return sorted(str1) == sorted(str2)" </s> remove     "def permutations_alt(str1, str2):\n",
    "    if str1 is None or str2 is None:\n",
    "        return False\n",
    "    if len(str1) != len(str2):\n",
    "        return False\n",
    "    unique_counts1 = defaultdict(int)\n",
    "    unique_counts2 = defaultdict(int)\n",
    "    for char in str1:\n",
    "        unique_counts1[char] += 1\n",
    "    for char in str2:\n",
    "        unique_counts2[char] += 1\n",
    "    return unique_counts1 == unique_counts2"
 </s> add     "class PermutationsAlt(object):\n",
    "\n",
    "    def is_permutation(self, str1, str2):\n",
    "        if str1 is None or str2 is None:\n",
    "            return False\n",
    "        if len(str1) != len(str2):\n",
    "            return False\n",
    "        unique_counts1 = defaultdict(int)\n",
    "        unique_counts2 = defaultdict(int)\n",
    "        for char in str1:\n",
    "            unique_counts1[char] += 1\n",
    "        for char in str2:\n",
    "            unique_counts2[char] += 1\n",
    "        return unique_counts1 == unique_counts2" </s> remove         test.test_permutation(permutations_alt)
 </s> add         permutations_alt = PermutationsAlt()
        test.test_permutation(permutations_alt.is_permutation)
      "Success: test_permutation\n",
       "output_type": "stream",
       "text": [
      "Success: test_permutation\n",
        "Success: test_permutation\n"
       ]
      }
     ],
     "source": [
      "run -i test_permutation_solution.py"
keep add keep keep keep keep keep keep
 Move string permutation to a class 
arrays_strings/permutation/permutation_solution.ipynb