13
1
Your input will be a string consisting of small english letters.
Your task is to determine the number of distinct permutations of the original string that are a palindrome.
The input string has up to 100 letters. In the case of a longer string the result might be very big so the output should be the number of permutations modulo 666013.
For example,
cababaa -> 3
The possible permutations are:
aabcbaa
abacaba
baacaab
This is code-golf, so the shortest answer wins!
2"Given that the string has up to 100 digits the result must be %666013." If so, it would be a good idea to include a corresponding test case. – Martin Ender – 2017-02-22T19:45:24.443
2
For future reference the sandbox sometimes works wonders
– Jonathan Allan – 2017-02-22T19:48:41.4434I don't understand the %666013 line. This is a promising challenge, though, and I'd be willing to vote to reopen once that's explained. – None – 2017-02-22T19:50:57.037
12Oh, now that's been edited, I see what you're getting at. I don't think that line adds to the challenge; it mostly just punishes languages without arbitrary-precision integers. Normally we do something like "the answer should be correct if run in a hypothetical version of your language with unbounded integers". – None – 2017-02-22T20:02:53.170
7This could really use more test-cases. – smls – 2017-02-22T22:44:46.730
3Suggestions for test-cases (please verify them though):
abcdabcddddd -> 120
(no odd character count),abcdabcdddddd -> 120
(one odd character count),abcdabcddddddeee -> 0
(two odd character counts),aabbccddeeffgghhiijj -> 298735
(affected by the modulo). – smls – 2017-02-23T00:00:28.797