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.
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.