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 comment is hidden because it contains spoiler information about the solution
simply cuz 1+1=2
but 97+97!=98
Same lol
Nice, but mine is better :P
Could've also used 1 in the place of 0 if im not mistaken...
Only a tip, the "if" is not necessary because the rangeClosed returns only one number when both are equals, and the sum() returns the number. Just a tip, but it was a clever answer, nice job!!!
me too hahaha
Relatable haha
after my 50 line solution i feel so stupid lol
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Boxing to Character is unnecessary in this case. Both methods toUpperCase / toLowerCase have overloaded versions that accept a codepoint.
In general, it's not a good practice to reassign the method argument.
If you are curious why - then please look at these method signatures.
It's a pretty helpful example because Node arguments have a meaningful name (and in general they must be meaningful).
And then if we treat an argument head as a usual variable its name becomes pointless.
And moreover in the case, if a method is much larger than a few lines or has an intricate logic then it's easy to introduce a bug because you forget that 'head' no longer points to the head.
sorry, what do (?=[\w\d{}\[\]]+$) mean?
And what if s3 is a bazillion?
It does not seem particularly efficient to range over 1..bazillion in steps of 1 looking for multiples
Loading more items...