📜  回文重排python代码示例

📅  最后修改于: 2022-03-11 14:47:10.246000             🧑  作者: Mango

代码示例1
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