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.
Depends on who you ask. For a simple conditional like this I find it more readable than having two return statements, but that's just my opinion
doesn't really make it any more readable though, does it?
could've one-lined this with the ternary operator
This comment is hidden because it contains spoiler information about the solution
how is this working without sorting the vector first?
oh, I like this one, linear time and O(n) less multiplications/divisions than in my solution
4-liner, cheating on whitespace doesn't count.
Use spoiler flag.
This comment is hidden because it contains spoiler information about the solution
The replaceAll method in Java takes in a regex as the first argument. Thus, . means "any character", so we replace any character with #
This comment is hidden because it contains spoiler information about the solution
The negative sign is not a digit, it is just a sign, therefore it shouldn't make a number to win
that's a best practice to remember ;)
You should considere it the other way around:
if mutation isn't explicitly allowed, it's forbidden
;)well mutation was not explicitly prohibited, although you are right, of course, this can produce side effects which would be not so easy to debug
Loading more items...