Beta
Grouping Expressions with Parentheses
Loading description...
Mathematics
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.
duplicate of this? https://www.codewars.com/kata/5e4073f990bbd20001adb72a
I haven't solved that kata, but the task in this one seems quite different, as you are adding parenthesis into a string instead of removing them, where there can be many more possible outputs. This one has additional performace requirements as well.
They're completely different.
The input term size is very small because reference solution is very slow. Perhaps it should be replaced a faster solution to increase the input term size?
Thanks for the feedback and much faster solution. Using your solution, I was able to add a test for n=11 and 2 more with n=10.
My submitted solution has a bypass to the incorrect behaviour, which is now mandated by the fixed test and random tests ;-(
You need to fix the tests and remove the bypass in the solution.
It should now be fixed.
Now there's an additional requirement to remove all trailing
0
s after the decimal point, but it is not mentioned in the description (still says "decimals ending with.0
").Added this to the description.
Random tests:
This should definitely be added to fixed tests as well (to catch incorrect checking of
.0
).Thanks for the feedback, I've added these to the fixed tests.