We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3c7925f commit 3cf8599Copy full SHA for 3cf8599
1 file changed
Python/palindrome-permutation.py
@@ -0,0 +1,10 @@
1
+# Time: O(n)
2
+# Space: O(n)
3
+
4
+class Solution(object):
5
+ def canPermutePalindrome(self, s):
6
+ """
7
+ :type s: str
8
+ :rtype: bool
9
10
+ return sum(v % 2 for k, v in collections.Counter(s).iteritems()) < 2
0 commit comments