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.
You're right, the contains just raised a flag but the string is constant.
Clever but not a best practice. This solution is inefficient as the growth is O(n^2).
You can reduce the memory footprint by replacing evenCount and oddCount with booleans set to true on the first occurance and exit on second if true. You would be replacing two ints with booleans.
Clever but not a best practice. This solution is inefficient as the growth is O(n^2).
This comment is hidden because it contains spoiler information about the solution