GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — leetcode/python/266_Palindrome_Permutation.py at master · qiyuangong/leetcode Expand file tree/ Copy path266_Palindrome_Permutation.pyMore file actions 18 lines (18 loc) · 419 Bytes / Copy path266_Palindrome_Permutation.pyFile metadata and controls18 lines (18 loc) · 419 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 class Solution(object): def canPermutePalindrome(self, s): """ :type s: str :rtype: bool """ dic = {} for c in s: dic[c] = dic.get(c, 0) + 1 odd, even = 0, 0 for c in dic: if dic[c] % 2 == 0: even += 1 else: odd += 1 if odd <= 1: return True return False |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |