Ruby translation kumited :) please check and approve ~~
return (braces == '');
This comment is hidden because it contains spoiler information about the solution
I like how the description starts with "please".
Thanks for the contribution & apologies for my haste in submitting
I had the same problem and found the same solution.
I've edited the kata to add the import and it is working correctly now.
got it, i actually passed it that way! But he has to fix it for other users, don't you think ?
If you put "from collections import Counter" in your code then it will pass -- it looks like the tests are assuming the user will have imported Counter rather than doing it themselves. I didn't use Counter in my code other than importing it to stop the tests from crashing.
I got same error
there must be bug in your global variable defination, here is why
Time: 159ms Passed: 42 Failed: 0 Errors: 1
basic tests (22 of 22 Assertions)
many duplicates tests (20 of 20 Assertions)
NameError: global name 'Counter' is not defined
Indeed true. You'd have a point saying I'm over-complicating things!
OTOH, there is that situation where a learner can use the syntax of a language feature, but doesn't know when the feature is appropriate - hence my comment.
Including the right degree of 'real life context' is a part of martial arts kata. Kata have the essence of an application for a hypothetical situation: they're taken from real life, but not messy like real life.
Hence (a martial artist might say) kata should have some degree of real-life context. And what is the essence & what's application details? That's a matter of discussion and discovery.
Again: I'm overthinking things. A simple exercize in syntax and some trivial fun is also useful of course!
Thanks for your comment.
Can you specify what you mean by "separating validation logic from business logic"? While this is a fun experiment with decorators, this is anything but clean code, given the trivial validation you are performing.