Ad
  • Custom User Avatar
  • Custom User Avatar

    Nothing has been done about this, should we drop performance constraints and approve at 5 kyu instead?

  • Custom User Avatar

    You're saying this is a just the warm-up kata? o_O

  • Default User Avatar

    What about the example in the sample tests? And which points exactly are unclear to you?

  • Custom User Avatar

    Link to part 2 added :)

  • Custom User Avatar

    Hi,

    • the user shouldn't have to go read external ressources to know what to do => how is the mask supposed to be used?
    • the sample tests should contain more tests. At the very least, the one of the description should be there as well.

    Cheers

  • Default User Avatar

    A lovely series of kata! Maybe you could consider also adding a link to the second part in this first part. I almost missed it as I didn't read the title carefully and would have hated to miss out on the fun of solving the second part too.

    Cheers

  • Default User Avatar

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

  • Default User Avatar

    Yes, I see your point. The adjecency matrix would always require n^2 space, even for sparse graphs, so this might not be the best option.

    For the indices, I then might as well change the dict to a list, since a dict of the form {0: val0, 1: val1, 2: val2} seems a bit odd. In that case, all of the previously submitted solutions will become invalid though. But that shouldn't be an issue, since the kata is still in beta, right?

  • Custom User Avatar

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

  • Custom User Avatar

    Usually network nodes are denoted as their index (or adjacency matrix) so it is actually in a performant, optimal data structure. Making it strings is seldom a good idea unless it has something to do with the specific problem, such as when the labels are actually meaningful (which does not apply to here).

    it is easier to read for debugging purposes

    This burden is on the coder. The kata design should not cripple itself for this (or at least should prepare a separate function for pretty-printing).

  • Default User Avatar

    Thank you for the feedback and for trying out this kata!

    Yes, I have a couple of ideas in these directions - I thought I would be able to come up with a general theory on optimal solution but I found a mistake in my first attempt so I will have to return to it when I have some new ideas.

    In the meantime I did a bunch of random simulations of movesets and found experimentally that the 500 moves limit held for all of them, hence the current upper bound (insert joke about differences between mathematicians, physicists, and engineers).

    I'll tag you if I have a nice idea for a draft/improved version in the future!

  • Default User Avatar
  • Custom User Avatar

    which language?

  • Default User Avatar

    when I test my solution everything is fine, but when I attempt, an error appears outside my code:

    In file included from main.cpp:7:
    ./tests.cpp:22:40: error: use of undeclared identifier 'h'
    for (; lowest < 10; lowest++) r += h(n - lowest, digits - 1, lowest);
    ^
    1 error generated.

  • Loading more items...