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.
Until this moment I thought my code is good. Damn you, kayakero!
Isn't it easier and more effective to use switch?
Not unless the kata explicitly asks you to solve the problem without using this very method.
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.
you should not add Strings in a loop
But that would really defeat the concept of doing the kata, wouldn't it?
IntStream has method avrerage(), so it should by solved by: Arrays.stream(i).average()
the last element in map is not needed )
No, so I guess there is a bug (at least)
Will pass2() reduce expressions of the form 2x3 ?
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
Resolved
That is the goal, however you don't need to use the Collections library to do it. It doesn't have shrinking it included, it is focused on expansion. The primary objective is to add the ability to expand like an ArrayList to an Array.
Loading more items...