add a test for empty strings

sorted('') == sorted('')
>>> True
This doesn't conform to the problem spec.
This commit is contained in:
rockybutler 2017-04-05 22:46:20 -04:00 committed by GitHub
parent f649a3fb3e
commit 571d1a0185

View File

@ -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)"
]
},