• Custom User Avatar

    [10, 3, 1, 0] is not a valid solution because it does not satisfy the condition d > 0.

  • Custom User Avatar

    a2 + b2 + c2 + d2 = n and a >= b >= c >= d > 0
    ...Perhaps there are a lot of valid results, please choose the one which has largest a...

    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

  • Custom User Avatar

    We cannot know what you're doing wrong without knowing your code, sorry.

  • Custom User Avatar

    "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.

  • Custom User Avatar

    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 turn a's, count from 3 to 4. You could do aaabb -> abba though, as 2 <= 3.

    I do agree that the description is quite lacking, but as this doesn't seem like a suggestion, I'm marking as resolved.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Review the definition of factor: https://www.britannica.com/science/factor-mathematics

    You're thinking about prime factors, and that's another thing.

  • Custom User Avatar

    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.

  • Custom User Avatar

    Since z/Z is the last letter to find, we only have to index to m/M.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This version of kata does not have inputs with adjacent +.

  • Custom User Avatar
    1. It is unfortunate that the kata's requirement's changed to include pieces with holes. My original solution would have sufficed.
    2. "There are no borders touching each others." Would the following shape be allowed (python)?

    "\n".join(["++--+","++--+","| |","+---+"])

    ++--+ ++--+ | | +---+
  • Custom User Avatar

    This has been changed by Voile. Now the function expects long long and it's ok.

  • Loading more items...