mirror of
https://github.com/donnemartin/interactive-coding-challenges.git
synced 2024-03-22 13:11:13 +08:00
add a test for empty strings
sorted('') == sorted('') >>> True This doesn't conform to the problem spec.
This commit is contained in:
parent
f649a3fb3e
commit
571d1a0185
|
@ -101,6 +101,8 @@
|
||||||
" def is_permutation(self, str1, str2):\n",
|
" def is_permutation(self, str1, str2):\n",
|
||||||
" if str1 is None or str2 is None:\n",
|
" if str1 is None or str2 is None:\n",
|
||||||
" return False\n",
|
" return False\n",
|
||||||
|
" if str1 == '' or str2 == '':\n",
|
||||||
|
" return False\n",
|
||||||
" return sorted(str1) == sorted(str2)"
|
" return sorted(str1) == sorted(str2)"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user