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.
Hi! I noticed that in your answer you also converted the letter
z
tos
, although I see no reason for this. I think the mistake is in this.The original sequence:
jdtqzbq
Correct sequence after conversion:
jdtpzbq
And the sum of the letters:
0 + -2 + 0 + 3 + -1 + 2 + -3 => -1
, thereforeRight side wins
I hope I helped you figure it out.
Yes, the description is complete. You don't need to see the source (i.e. the body of the function) to understand what it does: it returns a
TreeNode
. All it does is abstract away theBox
for you. I could post the code here, but frankly I think you're better served understand and accepting why this isn't necessary. If you look at the official documentation for any type, you'll notice that only the signature of methods is given, because that's all you need to know to work with it.EDIT:
I've since realised that the reason one might want to see the full implementation is to use this locally in your IDE. My bad. I've updated the description to show the full implementation now.
!
Probably a few hours, but it was a long time ago, so I really don't remember.
How much time have you spent on that? Have you went to the solution by yourself or tried to find these laws?
@compoterguy103
It's the shortest, sure, but the best? If I saw this in production code I would be kinda miffed because the return function is indecipherable.
Agreed. It only worked with one of the two, and that should be better specified.
You mean why it hasn't got a lower rating, don't you? I guess it's because one needs to cope with the broadly advertised "inappropriate wording" of the kata... ;)
Fixed. See other posts.
;)
This is just that this kata as some troubles or weirdness or whatever (might be that I don't understand unicodes too) and this test doesn't pass with a weird behaviour (length of the input different of the output... !). So I hardcoded this test.
Random tests are implemented, but only with standard characters, not unicodes.
EDIT : might be related to the python version used. I didn't investigate much about that...
Exercise test cases are now fixed.
Description updated, more and random tests added.
I added tests (including 100 random tests), updated the description and changed the title.
Please mark as resolved if you think these updates have fixed the kata!
Wow ! Marvel at the beauty.
That's very nice way to enforce generator. I've actually failed to get through one-liner before seeing the test code. That disassembly approach was quite aggressive.
I have no clue to apply similar approach to this Kata though. So far I had no luck on differentiating between regular codes and one-liner equivalents using
dis.dis()
or any otherinspect
functions.Loading more items...