Ad
  • Custom User Avatar

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

  • Custom User Avatar

    most users disagree, you can join beta process if you want to have your voice heard:

    {
    "data": [
    {
    "rank": -7,
    "count": 21
    },
    {
    "rank": -6,
    "count": 9
    },
    {
    "rank": -5,
    "count": 3
    },
    {
    "rank": -8,
    "count": 2
    },
    {
    "rank": -4,
    "count": 1
    }
    ]
    }

  • Custom User Avatar

    This kata should be 6q

  • Custom User Avatar

    I'd recommend having some larger values of n and m in the test cases to avoid a brute force approach.

  • Default User Avatar
  • Custom User Avatar

    I think you misunderstood the problem. The one asked isn't the result on the last iteration but the total number of iterations before reaching the last one. In essence:

    Iteration 1: 999 -> 729
    Iteration 2: 729 -> 126
    Iteration 3: 126 -> 12
    Iteration 4: 12 -> 2
    

    Which gives you a total depth of 4.

  • Custom User Avatar

    I see. I was only looking at the execution speed and didn't really take floating point accuracy into consideration when doing so. Thanks for pointing it out. I edited it out and now use lambda directly instead of defining a function. There's only a slight increase in speed now though.

  • Custom User Avatar

    I prefere mine. Doing so, you have a bit more computations each time (creation of complex number, then an internal square root when doing the abs. Note that your version is subject to floating point troubles, while mine isn't, specifically because I avoid float operations.)

  • Custom User Avatar

    This is just notes for those who use python and encounters this problem (Just like I did):

    • you can pass a list and a tuple as argument for game.check.
    • passing a tuple earns you a list of four "Black" if you managed to guess correctly.
    • Popping values from aset returns a tuple.
  • Custom User Avatar

    I tried modifying the error messge to include the target array length as clue. Is this fine?

  • Custom User Avatar

    Pardon, since this is my first kata, I think I misunderstood that preloaded stuff isn't included in the whole code run time. Thanks for pointing it out. I moved it now to the Test Cases tab. Thanks.

  • Custom User Avatar

    Sorry, my mistake, I probably forgot to check the example results. Thanks for pointing it out!

  • Default User Avatar

    In the example in description: why (3,0) isn't in returned_values?

  • Custom User Avatar

    "Something went wrong! He's still lost!"

    Such error messages are completely useless.

  • Custom User Avatar

    All the preloaded stuff should be moved to fixture.