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.
This is one of the shorter solutions that are using regex. I doubt that the beginning part of the regex
" *"
will match all whitespace characters. Consider using"\s*"
instead. Probably works only because current test cases don't contain other whitespace like\t
characters before the comment marker.Also, this regex works only if the comment markers are single characters.
Yes. I guess the fact that there are at least 3 possible reasons is enough to have more "clever" than "best practice" :-)
It's impossible to answer this question, this is just what people voted, each one may have their reason.
This comment is hidden because it contains spoiler information about the solution
Nice; I never saw Result before - thanks for the teaching!
I think this wording could be improved. I understood this rule to mean that the loop wouldn't have 1 follow 9, unless there was a 0. Therefore: 901 would be good, but 912 would not.
A second sentence like this one would help: "a sequence will not roll over after the last digit, so 1 will never follow 0"
k it was a brainfart
This can be checked pretty easily:
Hi,
I tested 8 solutions in python/JS (most upvoted and users I trust about having a proper solution) and they all find 18685 for that input. Now,I'm not entirely sure which one of yours or the translator's solution found 18683 when I read your sentence. Could you clarify, plz?
I was pressing
attempt
multiple times to make sure my code isnt making any very rare mistakes,and I think I found a mistake in the c# translation author's solution.
It thinks that the index of 4949 should be 18685 when its actually two less (18683)
This is really rare and you can easily pass the random tests but i thought id mention it.
that's right :) Thanks
the
?:
operator is useless here. the left of the?
already returns your boolThis comment is hidden because it contains spoiler information about the solution
I spent like 1.5 hours on this and got the shortest solution this kata has so far I think :D
so please press clever on it
thanks for this. I learned more about regexes and will use this info if i can :D
Loading more items...