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.
👏🏻 your decode() is a thing of beauty
Second sample test, I'm getting
Expected :[[0, 6, 1], [1, 1, 1], [1, 6, 2], [2, 1, 5], [2, 6, 7], [4, 2, 6], [6, 7, 3], [7, 1, 2], [7, 4, 4], [7, 7, 1], [8, 7, 3]]
Actual :[[0, 6, 1], [1, 1, 1], [1, 6, 2], [2, 6, 7], [2, 1, 5], [4, 2, 6], [6, 7, 3], [7, 1, 2], [7, 7, 1], [8, 7, 3], [9, 4, 4]]
It's not obvious to me why (8,3,4) would move to (7,4) over (9,4). It is within three moves of both (9,6,3) and (5,6,3), but travelling towards (5,6) requires moving in a less clockwise direction.
A note if you're doing this in Java, make sure to return an ArrayList to avoid the UnsupportedOperationException.
Great work on the kata!
Damn, thought I was there,
then discovered input 12311133345899.
now need to rethink my core values
this one was harder for sure
The Tao of Programming right here
Do you think I should raise it to 3kyu?
I do think we underestimated the difficulty level of this kata. I don't think anyone has solved this kata yet after approval.
Yeah, that's really weird. I tried running your solution and I couldn't get the print statements to work (except for the first one, for some reason. If I remove it, nothing is printed at all). I read the test cases and found nothing that may prevent a print statement from executing... not sure what's up.
Yeah, clearly I have to make it more efficient (seems I overestimated the power of generators)
The entire dictionary does print though, but not the int parameters. That's what struck me as weird
True, it's quite strange... if I were to take a guess, I would assume this is a symptome of trying to print a dict of this size: while it's useful to see the example tests' ingredients to find the cause of any bugs, it's pretty much pointless on the performance tests, because there's too many ingredients to check.
Actually, it's straight up counterproductive because print statements impact your performance: if I were you, I would remove print statements when I'm going for the submission rather than the example test cases. As stipulated in the kata description, example test cases should be enough to confirm your algorithm is correct, so you shouldn't need to "debug" performance tests.
Oh, you meant the
print("goal flavour: ", flav)
. I thought you are talking aboutprint(results_list)
.You're right, that's pretty weird.
Why would that prevent the second print statement from executing though when it comes before the generator expression
The second print there doesn't execute because there are
26^2
ingredients.With that amount of ingredients, currently your code is checking this many possibilities:
Of course, checking all 1 trillion possibilities would be very slow.
This comment is hidden because it contains spoiler information about the solution
Loading more items...