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.
I wouldn't say you "shoudln't". It depends on how frequently this method is invoked. But this solution is way more readable than any of those performance optimized implementations.
Until performance becomes an issue, I favor readable/understandable implementations over fast ones.
chars() returns an IntStream of the char values in a given CharSequence
nope, also in the kata's testcases there are "unboxed" vertical cows. and my input is not exactly ambiguous. there is only one correct way to interpret it. however most implementations fail a field like this.
@bittersweet69: false, there are 4 cows in my example:
Three facing south, one facing north.
Exactly what I mean by ambiguity.
I fixed a typo in the class name, now this became invalid ;)
You are right, thanks.
Should be fixed now.
Especially considering 'Since this is the wild west, with dreadfull weather and not much water, it's important to save yourself some energy, otherwise you might die of thirst' ;-)
some abiguity in the tests would be nice. Most of the solutions there are so far fail when tested against a field like this one: