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.
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.
No, so I guess there is a bug (at least)
Ok,
null
is expected when a function is added.I'm stuck with
functions(InterpreterTest)
test case.My code return
0.0
when a function is added (I didn't see in description what it should return).fn one => 1
looks fine for me so I return0.0
but I guess anException
is expected.conflicts
test case pass and there is almost the same situation E.g :fn f => 1
Can someone tell me why ? or what is expected ?
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution