Beta
Hydra Monster
Loading description...
Fundamentals
Trees
Simulation
Strings
ASCII Art
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
Nice challenging kata. People usually afraid of katas with long description. But this description covers all cases with examples. Small issue: there are unmatched brackets in last two examples in description. Suggest tag: ASCII Art.
Thanks for the feedback. Description edited.
Please add a sample (and fixed) test case for "Prime hydra"
My current solution is failing this and it is only caught by some big random tests.
added
After fixing my code for this case I still had a failing big random test but couldn't bother to investigate further and just implemented a better cleanup after cutting which worked.
Congrats on solving. I'll play around with your solution to see if I need to add more edge case tests or generate specific patterns in random tests.
I created a fork of my solution with the failing one: https://www.codewars.com/kumite/662a933260dd803749519959
sure
This comment has been hidden.
Additional poke, I think spoilered comments don't send out notifications.
Thanks I'll add such test case in heroic battles and sample tests soon.
In Type 2 regeneration examples in the description the root node is sometimes a body
x
and sometimes a head#
. I have the feeling that these belong together and it should be consistent. Otherwise the question comes up where the head in the root spawns from.I don't really get what you're getting at. Is the description not consistent, or the problem? I feel the problem is consistent, in that when the root body gets cut, a single head spawns as root as a last resort hydra. Cutting that head kills the Hydra. Let me put it this way, whenever you cut a
x
, that part and all its descendant parts get cutt of and get replaced by a head#
. The root body is no exception to this rule.It's the example in the description:
x
as root#
as rootSame goes for the next part where the ids are shown.
You cannot have a head with child nodes I think.
You are absolutely right. A head never spawns any additional body parts as descendants. This was a rendering mistake of me in the description. Fixed