Can someone please share me some guidance of how to solve this problem? I am not aware of any of the methods those have been used to solve this problem. Link or topic names regarding methods to solve this problem, would be much appreciated.
If the actual line starts with zero or more whitespaces and an closing bracket }, this bracket, and only this first one, should be taken into account for the calculation of N by adding an additional closing bracket to the result.
Well, either you're absolutely explicit about trailing spaces and you show a clear example about that in the description/give the rule, or just ask for triming the lines while correcting indentation (or just don't use/generate inputs with "hidden chars"). ;)
'Syntax error' should equal 'h{wHZyks}csRoJVAjtbmBbu'
The input validation makes this kata more annoying than anything. No sane person will waste their time building blocks upon blocks of if's to handle this mess of random chars "correctly". Especially, when you can submit a couple of times, and eventually pass.
This comment is hidden because it contains spoiler information about the solution
JS code length test can be bypassed: https://www.codewars.com/kata/reviews/5d2996110abb7b00018ca285/groups/5eab87d9d0f3e000012a02ce
Input modification test provides zero value to the task.
Can someone please share me some guidance of how to solve this problem? I am not aware of any of the methods those have been used to solve this problem. Link or topic names regarding methods to solve this problem, would be much appreciated.
So how should such case be handled?
XD
Serioulsy? ;o
Well, either you're absolutely explicit about trailing spaces and you show a clear example about that in the description/give the rule, or just ask for triming the lines while correcting indentation (or just don't use/generate inputs with "hidden chars"). ;)
The input validation makes this kata more annoying than anything. No sane person will waste their time building blocks upon blocks of
if
's to handle this mess of random chars "correctly". Especially, when you can submit a couple of times, and eventually pass.The rules about invalid programs should be made more clear. Is it valid for a line to begin with
{
?Also, random tests seems to generate lines with multiple brackets on same line, but how that should be handled seems to be unspecified.
Slicing in groups of
n
is not a new kata idea.I think strange things can happen to some of the accepted solutions if you get too close to the limits of the data type the file size...
e.g. (in
C
)Perhaps Kata description should say these kind of boundaries are not tested by the Kata...