Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

palindrome rearranging python

import collections
def palindromeRearranging(inputString):
  cnt = collections.Counter()
  odds = 0
  for i in range(len(inputString)):
    cnt[inputString[i]] += 1
  for i in cnt:
    if cnt[i]%2 == 1:
      odds += 1
  return odds <= 1
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #palindrome #rearranging #python
ADD COMMENT
Topic
Name
3+5 =