You would better add "minimal" before "number".
return the "minimal" number of parenthesis reversals needed to make balanced parenthesis.
After all,there are several ways to make balanced parenthesis.

I'd be really grateful if someone could explain this to me. I have (i thought) solved this using recursion and shift and pass all of the initial tests but fail all of the ones saying "it should work for random inputs too". Why should the resulting arrays be full of zeros? I'm fairly new to this so if anyone can provide an insight that would be wonderful!

let tempstr = strarr.slice(i, i+k).join('');

is this not easier rather then making tempArray and tempStr? or am I missing something?

I got it.

This comment is hidden because it contains spoiler information about the solution

Let me have a look :)

Nice one.

Mine is sooooo much more complicated, Duhhh!

This comment is hidden because it contains spoiler information about the solution

.

666

Many thanks. Done!

Sleep over it. You can do it

You would better add "minimal" before "number".

return the "minimal" number of parenthesis reversals needed to make balanced parenthesis.

After all,there are several ways to make balanced parenthesis.

Dam

Let me have a Look :-)

Use pure functions - no side effects - or, in other words, do not change the input array: it is bad practice and you will not pass the tests that way.

I'd be really grateful if someone could explain this to me. I have (i thought) solved this using recursion and shift and pass all of the initial tests but fail all of the ones saying "it should work for random inputs too". Why should the resulting arrays be full of zeros? I'm fairly new to this so if anyone can provide an insight that would be wonderful!

## Loading more items...