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.
( duplicate comment )
That's what you get, sometimes, with translated kata. There are technical reasons for not changing the original description.
If it's very unclear what the ( type of the ) expected return value should be, please raise another issue.
Closing.
This comment is hidden because it contains spoiler information about the solution
temporary issue of CW's servers, not an issue of the kata. Closing.
Help us help you. Tell us in which language you have this problem.
add a "s" behind the "play"
You should provide more details on why adding String in loop is a bad practice (performance issue) and a solution (
StringBuilder
). I don't remember this kata but a Regex compiled in a loop plus aScanner
are overkill and even worse than a String adding. A better way is to usePattern
/Matcher
andparse...
function fromDouble
andInteger
.In any case this code is not a 'Best Practices', but a quick-and-dirty simple solution.
It's run a predicate against number that first converted to string. Predicate is an interface with single method
boolean test(T object)
(T is a String in this case).With
Stream.of(...)
we creates a stream of predicates. And withanyMatch(...)
we test each predicate if it's returns true for incoming number.trim the string that you are returning.
You're not returning the correct result.