From 571d1a0185f0519a90ca0754676e8f1bbd1ca4d9 Mon Sep 17 00:00:00 2001 From: rockybutler Date: Wed, 5 Apr 2017 22:46:20 -0400 Subject: [PATCH] add a test for empty strings sorted('') == sorted('') >>> True This doesn't conform to the problem spec. --- arrays_strings/permutation/permutation_solution.ipynb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arrays_strings/permutation/permutation_solution.ipynb b/arrays_strings/permutation/permutation_solution.ipynb index 2cca059..1ab7b23 100644 --- a/arrays_strings/permutation/permutation_solution.ipynb +++ b/arrays_strings/permutation/permutation_solution.ipynb @@ -101,6 +101,8 @@ " def is_permutation(self, str1, str2):\n", " if str1 is None or str2 is None:\n", " return False\n", + " if str1 == '' or str2 == '':\n", + " return False\n", " return sorted(str1) == sorted(str2)" ] },