The ranking levels have changed significantly recently a lot of the older kata would be ranked very differently if published today, and a lot of them would never be published today.
I was looking for a request like this.
It would be great if solutions have the "benchmark score" visible & sortable.
Some languagues (go) have build-in benchmarking, you could perhaps use that as well.
This would bring in a lot more fun browsing for the most optimal solution.
Where do you see it called for each letter? It's called once. And calling ToLower for each rune would do the same amount of work and save some memory (not that it usually matters, though).
A very succinct and elegant solution.
One thing I would change is to pull the strings.ToLower() above the for loop, calling it once for the whole string instead of calling it for each letter.
You have an unnecessary overhead.
It's better to convert the whole string before the foreach (strings.ToLower(string(s))) instead of doing it len(s1) times.
Is like I do it?
The ranking levels have changed significantly recently a lot of the older kata would be ranked very differently if published today, and a lot of them would never be published today.
I was looking for a request like this.
It would be great if solutions have the "benchmark score" visible & sortable.
Some languagues (go) have build-in benchmarking, you could perhaps use that as well.
This would bring in a lot more fun browsing for the most optimal solution.
Theres an variation of this Kata that has not only brackets
"()"
but all of the others as well"()[]{}"
, here's a link to it.Which (if I'm not missing something) makes it harder then this variation, and yet it's 6 kyu while this one is 5 kyu.
This should be reconsidered.
This comment is hidden because it contains spoiler information about the solution
You could optimse this a bit by setting
i := 3
(in the loop) right off the bat, since we're only interested in numbers >= 3Ahh my bad I've missread the code. Thanks for correcting me, my bad.
Where do you see it called for each letter? It's called once. And calling
ToLower
for each rune would do the same amount of work and save some memory (not that it usually matters, though).A very succinct and elegant solution.
One thing I would change is to pull the
strings.ToLower()
above thefor
loop, calling it once for the whole string instead of calling it for each letter.You have an unnecessary overhead.
It's better to convert the whole string before the
foreach
(strings.ToLower(string(s))
) instead of doing itlen(s1)
times.