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.
your code is correct but too long
check if the error is from an empty list
I can't find that test case in the Java tests; can you take a second look and confirm please? If it's gone please close the issue.
Isn't this a mistake in the test? assertEquals("aaaccccbbdd", Kata.hasSubpattern("abcdabcaccd")); The sorted string is "aaabbccccdd"
my face reading this be like: [^_-]
With input "abc(" it loops forever.
With input of "ab(cd", output should be "ab(cd". But with this you would get "ab". Maybe it would be useful to save last index of where you open parentheses, and in the end of loop, there could be a check if sum == 0. If not, sum += str.substring(savedIndex).
i think this might work as well:
name.replaceAll(".*\w(\w+$)", "$1");
This comment is hidden because it contains spoiler information about the solution
switch would be even more elegant ;)
Closing; issue doesn't seem to exist.
Why does this work? Doesn't ".reduce((a, b) -> -1)" mean that int i will always be -1?
In the getter, if (side == 5) { side = 0; return 5;}. This is stupid, but fixes the mistake in the tests.
This generates IntStream too many times.
This comment is hidden because it contains spoiler information about the solution
Loading more items...