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.
And is correct that way because inputs "... are always lowercase strings, and that each has at least two letters.". If that was not the case and arbitrary inputs would be allowed we'd also need checks for
null
and lengths in order to avoidNullPointerException
andIndexOutOfBoundsException
or alike.it work only if cases are equal
I would rather have more spaces to increase the readability of the code, but it's okay
Not true. If n or m are 0, first if will be true, and return 0
Very efficient
If n or m are 0 you will return -1. Why test didn't check that?
If n<0 and m<0 your code will not see an error, but I understand, that there won't be negative input.