6 kyu
The Hackers’ Taunt
Loading description...
Lists
Arrays
Recursion
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.
Test output is legitimately horrendous:
I am sorry for that. Should be fixed now, but, if anything, please let me know.
Thank you very much for kata approval!!!!
Hi,
''.join(random.choices(letters, k=random.randint(3, 6)))
, andletters
should be defined outside of the functionCheers
Hi! Thank you so much for telling!! I have tried to adjust the random input generation and it seems to be okay now. And thank you for telling about
random.choices
, I didn't know there is such a convenient way of generating strings!! I changed it to use random.choices! Can I also ask you about passing the deep copy of the input? So as long as I call the user's function after computing the expected output it is fine but then do we need to pass a deep copy for the fixed tests or this is also fine?I didn't notice about the fixed tests. You don't need the deep copy there either, yes.
About the random generator, I have to say... I'm worried about these conditions:
if current_depth != 1:
. Why? Strings should appear anywhere in the structure, whatever the depth.Thank you for explaining about fixed tests! As for that condition, I made it like that because initial idea was that the main list have lists and those lists have either strings or other lists and I noted that in the rules. I was actually also thinking that it would probably make more sense to switch it so just strings anywhere but something stopped me from doing it. I quickly tested my solution with the strings in the depth 0 just now and it seemed okay, so if everything goes fine, I will change it tomorrow to include them as you advised! Thank you!!
Hi! I am sorry, I will have to put it off until tomorrow, I wanted to do it this evening, but I have a strong headache and feel like a vegetable. I remember about the promise and will definitely do it.
there's no hurry, don't worry.
Thank you!! I have just updated the spec and all of the tests to include strings in the shallowest 0 depth. It looks now so much better with them ! :]
.