7 kyu
Magical Duplication Tree
Loading description...
Mathematics
Performance
Algorithms
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.
Since this kata is tagged as performance, you could make your tests more demanding. I fail to see a solution so poor optimized as to fail these tests by timeout the way they currently are.
It's harder now, I had to change my solution because mine was one of the least time-efficent of them all.
What happens for, say,
magic_plant('o', 2, 1)
? This case of splitting past the trunk is not mentioned anywhere.All tests given are valid, adding a sentence that states this in the description.
This comment has been hidden.
ok.
Actual testcase line 35 / Sample testcase line 32:
print(magic_plant(plant_2,4,1),1)
, change this line to a proper assertion / remove.👍
p_feild
seems to be a typo, though I can't be sure considering how consistent it is.Even if it is, though, you shouldn't invoke the function using keyword arguments in your tests unless you have a good reason to do so, since now you make it unable to change the name of the parameter of the function. Prefer to use ordered arguments instead, i.e use
magic_plant(1, 2, 3)
instead ofmagic_plant(p_feild=1, split=2, n=3)
Also, afaik it's not required to assign a rank to a beta kata.
Function with keyword argument at sample test line 15.
Oops, forgot to check both test windows. Fixed as well