palindrome rearranging python

Solutions on MaxInterview for palindrome rearranging python by the best coders in the world

showing results for - "palindrome rearranging python"
Rory
01 Jan 2019
1import collections
2def palindromeRearranging(inputString):
3  cnt = collections.Counter()
4  odds = 0
5  for i in range(len(inputString)):
6    cnt[inputString[i]] += 1
7  for i in cnt:
8    if cnt[i]%2 == 1:
9      odds += 1
10  return odds <= 1
11