5 kyu
The Dots and Parentheses
69 of 101qpwedev
Loading description...
Algorithms
Puzzles
Strings
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.
is there a way for a possible solution without recursion?
yes. every recursion could be rewrited in loops if language allows loops
Python version: tests for 0 to 11 should be added to sample tests like the other language versions.
someone did
This comment has been hidden.
Can you help me? How to fix it?
This comment has been hidden.
I added new tests, thank you
Ruby translation: https://www.codewars.com/kumite/5fe6342121683a0021e3adee/edit
Haskell translation
Why not a decoder as well as an encoder?
The algorithm for that can be as elegant as for the encoder.
JavaScript translation
This solution usually fails, but sometimes passes all tests. Whether it's correct or not, it should pass of fail consistently.
Fixed, thank you
This comment has been hidden.
IMHO it should be
'((()()).(()))'
, but I'm not the author.Yes, my bad. Fixed
.
Same as below (open as issue), you need to add random tests.
Can you help me? How can I do random tests?
Random tests are where you give the user 100-200 random natural numbers (between 1-10000). Then you test that they are right. To do so, you check that their answer is the same as your answer for a given natural number.
To generate a random number:
Then create a function as the reference solution:
Now test it:
If you need more help then go to: https://github.com/Codewars/codewars.com/wiki/Codewars-Python-Test-Framework-V2
Thank you
Fixed
You need random tests to prevent hard coded solutions, FYI.