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 used to do it similar, but eventually switched to set the initial value to the value of 1st element (index 0), it then compares index 0 to index 0, but no need for
Integer.MAX_VALUE
or extra code.Yeah, better use a Stringbuilder, but beside that I like the idea (clever, but not very optimised - neither performance-, nor memory-wise)!
Thx for the info! And it is great that Lists are supported here (Edabit does not, also you have to pay after a certain amount of XP)
That syntax was introduced in Java 14. I would guess CW will use only LTS versions of java.
LOL, and the real solution is soo simple …
This comment is hidden because it contains spoiler information about the solution
Also wonder, why you have to use break; for every case, but seems to be standard in most languages, who knows why …
PS: Guess, that's why: https://stackoverflow.com/questions/2710300/why-do-we-need-break-after-case-statements/2710312#2710312?newreg=ea561585a402486c989eefd3bb162979
And if you always just need one case, I would prefer:
case 'n' -> y--;
- but that doesn't work here.