Ad
  • Custom User Avatar

    Your code fails to address this --> There are no fractions of people. At the end of each year, the population count is an integer: 252.8 people round down to 252 persons.

  • Custom User Avatar

    Sorry for delay on answering.

    You can think about that if you need to move 1 box to the second, then move 100 to first ([1, 100]). See what your code return, compare with the correct answer counting by yourself.

  • Custom User Avatar

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

  • Custom User Avatar
  • Custom User Avatar

    Carefully read the first example in the description.
    If needed, perform your algorithm by hand and compare the results for each step.

  • Custom User Avatar

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

  • Default User Avatar

    Hi @MichosDV - it seems that you have passed the kata, so just adding this comment so that other users don't think there is anything weird/problems with the kata.

    FYI, your problem is/was probably due to the behaviour of //, for example:

    correct = 1 # let's say this is the correct answer
    your_sol = 1.372 # let's say this was your answer
    
    rounded_with_6 = (your_sol * 6 ) // 6
    rounded_with_591227 = (your_sol * 591227 ) // 591227
    
    print(rounded_with_6) # = 1.0, now matches the correct answer
    print(rounded_with_591227) # = 1.0, now also matches the correct answer
    

    you can see above that multiplying by 6 then // 6 just has the effect of rounding your answer; the specific value of 6 is irrelevant - you could just as well use 591227 as I did above.

    The "exact solution" - being made up of a sum of integers - shouldn't need to be rounded though at any point, so I'm not sure where your tiny mistake crept in.

  • Default User Avatar

    The exact solution does not pass. Multiplied by 6, then //6, and all the tests passed.

  • Custom User Avatar

    i don't understand the task and "Euler transform"

  • Custom User Avatar

    which language?

  • Custom User Avatar

    You must use BigInt for all numbers in this kata. When you have an integer in variable a, you can wrap it as BigInt(a). When you have a value, let's say 10, you can make it a BigInt by appending 'n' to it 10n

  • Custom User Avatar

    There are 500 random tests. You should try to optimize more

  • Custom User Avatar

    How many random tests are in the attempt? I get around 60 and I cannot complete them within 12 seconds.