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
Very efficient
Thanx!
It is far more efficient if you create a Set with the valuesList Array instead of a list.
This is because checking if a Set contains a value, is O(1), while checking if a list contains a value is O(n).