Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
having conditions will make it slow too, probably even slower.
the code is readable however the code provided here is not efficiant guys as the complexity is O(n * 3). as here we loop three times instead we can use one loop with three condition and make the complexity to be O(n).
It's readablle, but where is the 'Best Practices' in this solution?
good but slow
Very readable. Let the machine work, not a man.
The problem is that
static
preservesi
across every call toreplaceNth
. It's only assigned0
at compile time. After that each iteration updates the value. So if you're only running this once then it'll behave as you intended. After that first pass it's anyone's guess as to what the starting value will be. Removestatic
, move the declaration outside the lambda, and change the capture from[=]
to[&]
. It'll work fine then.Fixed
Kata dificulty is relative to your knowledge and experience. For example before I did my first graph problems I thought it was difficult, after a few then not so much. If you've done ASCII operations before of course it is easy.
Yeah, this was definitely an 8 kyu challenge.
Gern geschehen! Danke, dass du mich auf den Fehler aufmerksam gemacht hast! :-)
I just tested it, the issue is fixed. Thank you, @HerrWert.
@siebenschlaefer, do you not have write access because you've contributed to this kata? :-)
https://www.codewars.com/kata/pole-vault-starting-marks/edit
OK, thanks for that tip. I just added that line above the tests. I placed it directly above another #include statement. Please let me know if that works.
@Dentzil, @HerrWert or anybody else with write access:
Just put the line
on top of the tests.
expected:78 but was:23??? Got it right but fails to submit, also That was quite easy for the level. Good one Though
Loading more items...