7 kyu
The Hidden Word
705 of 1,864veredrec
Loading description...
Strings
Regular Expressions
Fundamentals
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
C#: method name should be
PascalCase
(Please refer to implementation of backward compatibility here )Python new test framework should be used (Refer this & this for more detail)
Ruby 3.0 should be enabled (Refer this & this for more detail)
Updated python's test framework
Ruby 3.0 enabled in this fork
No random tests in JS
Node 12 should be enabled (Refer this and this for more info)
Fixed
This comment has been hidden.
I've written up my answer for this (in Python), and it works with all the test cases I can see when I run it in PyCharm. However, on here I'm getting an error. I can pass the first test ("aid" equals "aid"), but then it keeps saying the second test isn't right. It'll say "debtaid" should equal "debt" or something similar. I'm running my program with the numbers they say were tested, and it gives the right answer. I don't know why it doesn't work on the actual site... I'm new here, though. Am I missing something?
Hi! I'm not sure what the problem is and I didn't write the python version (unfortunately, I don't know python...), but I saw that more than 75 people solved the kata using python, so my guess is that the kata works fine :) I hope it helps...
"The tests cases you can see" are only a part (sometimes, just a small part) of the full list of tests used against your solution. So if you get an error, that means that your code is not good enough, not that the kata as some troubles. ;)
You should try to print informations in the console of what's going on under that error.
Okie doki. I wasn't so much questioning if the kata was wrong as I was confused about the discrepancy between the output I got when I ran my program in PyCharm versus running it here. In other words, I get the correct output when I run it in PyCharm, but not here. I was just curious if that's happened to someone else and if they had insight into how to fix that.
Update: Okay, I think I figured out what's going on. I had set a global variable outside the function, and it's not clearing when a new test starts. That's what's causing the test words to get added together. Unfortunately, I am not entirely sure how to fix that. Only been a computer science student for a semester. ^^'
Hi @chall92. Copy your code here and mark it as spoiler and i'll take a look :-).
This comment has been hidden.
You should pass your list as an optional argument. This way, you could avoid the global variable:
Using optionnal argument, your empty list will be automatically generated by the external call to
hidden
.Or you could avoid the recursion with a
while
loop.Note: when you post your code, do not forget to use
tabs
to reproduce the indentation. Absolutly important to understand python code ! (begin the code with 2 tabs before it)Oh! I wasn't sure if I could do that since the tests I could see being run only had the one argument. I was afraid it would mess things up.
Sorry about that. I did try to get the indentations to show up when I copied and pasted my code, but it wasn't working for me. I only joined last week. Still learning how things work here. Thanks for your help!
"Maya won't forget to thank you at the end of her article :) "
Where is she then :D?
Nice little challenge, with room for optimisation if the coder feels like it. Well done! (Story is a little conveluted for the task, but whatevs ;P)
Crystal translation there for you :)
Thank you!
Ruby, Python and C# translations submitted :-) please check and approve
Thank you so much! All approved :)
A good amount of fixed tests but would be even better if there were some random tests as well ;)
Getting mild in your old age? :P
Thanks! I'm not an expert but random tests would not always provide valid words... that's why there are no random tests for this kata.
This comment has been hidden.
It depends. Is 18 years old considered old age? ;)
I appreciate your suggestion and I would definitely think about it! Thanks!
Added random tests for JS