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 love you
We can also modify global variable through IIB (Instance Initialization Blocks). You can check my solution for reference.
FYI error your code gives is:
Looks like only way for that to happen is because your code does not handle
nFloors
of 0.Apparently back then if I'm understanding correctly, the kata expected "int[]" to be returned instead of "HashMap<String, int>" despite saying that it needs to be an HashMap. So now, it's fixed but there's still backwards compatibility for "int[]" solutions.
This comment is hidden because it contains spoiler information about the solution
Yeah, mine asked for a HashMap too. And we have the same solutions. I would say we are good. :)
the String u: find the digit at the end of str and plus 1 to it, else no change to string
return: check if the string has a digit -> then return it as is or plus 1
technically the return could be better written like this
return u==str?u+1:u;