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.
Do not
if (expr) return false; else return true;
Just use logical not:
return !expr;
Hi! Yea, you right. This approach is for more general case and was used hastily.
Thanks for your attention.
Check the fork ;)
Is there a reason you did s.length() - s.replace("1", "").length() instead of just replacing all the 0's with "" and returning the length of that? Seems like that would save on a calculation by not having to subtract and you're already doing the replace anyway. Can do it without having to store the string as well that way.
Don't course, use tripple equalls unless you have a specific reason not to.