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.
to get rid of it
Thank you.
Such a graceful solution!
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
I we know the library methods, then why not?
I would rather place an if statement in your for loop to only edit the characters which are alphabetical. do something like if(Character.isAlphabetical(string.getChar(i))) { }. This means the for loop will not do anything with the blank spaces so long as you're adding to the array in the if statement.
Should it have been though?
Java has dynamic arrays called ArrayList.
But your solution doesn't need them, just think about what Chrono79 said.
It is possible to know its size beforehand.
Strings in Java are immutable, but if you reassign them, your command should do what you want.
str = str.replaceAll(" ","");
If you want to remove all non-visible characters (e.g. tab, \n), go with:
str = str.replaceAll("\s+","")
actually, it's even said in the description... x)
the expected ouput is an empty array. The real issue here is that the behavior isn't documented in the description.
若测试用例有2位数字的话,这个答案就不适用了
1- It is a question not an issue.
2- 1165 guys passed the Java kata (see at the top of the page), if there were errors somebody would have seen them.
3- There are more fixed tests when you "SUBMIT" than in sample tests.
4- I tried a few solutions and all was fine.
5- You code could be wrong:-(
This comment is hidden because it contains spoiler information about the solution
You didn't understand what to do, it's not the biggest number you can make with those digits, it's the next bigger number.
Loading more items...