"For this Kata you need to write a function that takes a string of characters and returns the length, as an integer value, of longest alphanumeric palindrome that could be made by rearranging the characters."
I think this more clearly and concisely explains the goal.
[10, 3, 1, 0]
is not a valid solution because it does not satisfy the conditiond > 0
.The following basic test case in Python would contradict the description.
test.assert_equals(find_4_numbers(110), [9, 4, 3, 2])
While [9,4,3,2] is a solution:
110 = 81 + 16 + 9 + 4 110 = 9^2 + 4^2 + 3^2 + 2^2
The solution with the largest a-value is [10,3,1,0]:
110 = 100 + 9 + 1 + 0 110 = 10^2 + 3^2 + 1^ + 0^2
We cannot know what you're doing wrong without knowing your code, sorry.
"For this Kata you need to write a function that takes a string of characters and returns the length, as an integer value, of longest alphanumeric palindrome that could be made by rearranging the characters."
I think this more clearly and concisely explains the goal.
The emphasized part is saying that the final palindrome should never have a letter appearing more in it than in the original string.
So you can't do
aaabb
->aabbaa
, because that would turna
's, count from3
to4
. You could doaaabb
->abba
though, as2 <= 3
.I do agree that the description is quite lacking, but as this doesn't seem like a suggestion, I'm marking as resolved.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Review the definition of factor: https://www.britannica.com/science/factor-mathematics
You're thinking about prime factors, and that's another thing.
1 is not a prime number. Therefore 1 cannot be considered a "factor", but 1 is a divisor of the base. Consider renaming the kata and objectives.
Since z/Z is the last letter to find, we only have to index to m/M.
This comment is hidden because it contains spoiler information about the solution
This version of kata does not have inputs with adjacent
+
.
++--+ ++--+ | | +---+"\n".join(["++--+","++--+","| |","+---+"])
This has been changed by Voile. Now the function expects
long long
and it's ok.Loading more items...