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.
That basically means comparison by character codes. First non-equal comparison wins. '1' comes before '2', so 1anything also comes before 2anything.
As it turns out, string comparison in basically every language already works this way.
If we're going to engage in pedantry, the correct use would be "Hello, Name. How are you?" :)
I saw a pattern pretty much immediately, but i also started with more moving parts. :P Probably took 15-30 minutes farting around with concatenation before i saw a less clunky way.
This comment is hidden because it contains spoiler information about the solution
Just published a NASM translation.
This comment is hidden because it contains spoiler information about the solution
And
null
is not""
.In nearly all cases where you're passing null instead of a string, it is an error. IMO, it should cause an exception, unless you have a well-defined behavior for that case, as otherwise you're allowing bugs to propagate.
Except you're making it much more difficult to handle those errors at the source.
Most of the other solutions will fail if cc == null as well...and frankly, that's the right thing to do, unless the problem specifies a behavior for that case.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
C++ random tests sometimes have p > n. What's worse, they expect a value that doesn't even make sense in that case.
Workaround: just keep submitting til tests succeed.