Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
no...?
Nothing has been done about this, should we drop performance constraints and approve at 5 kyu instead?
You're saying this is a just the warm-up kata? o_O
What about the example in the sample tests? And which points exactly are unclear to you?
Link to part 2 added :)
Hi,
Cheers
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
This comment is hidden because it contains spoiler information about the solution
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?This comment is hidden because it contains spoiler information about the solution
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).
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).
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!
C++
which language?
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...