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.
was thinking one should provide one's own implementation of such and then use is in an assert equals test to find, with run(), the perfect chromosome, which is used to build the fitness function???
I think this solution is harder to read than an inline if
Nothing. Regular string concatenation faster that String#format. You can find in google performance of regular concatenation and String#format.
changed
The use of prevdist was a good catch!
The performance of the solution though doesn't look very good (O(N*M)).
One way to improve that would be by creating a map of distances using the input matrix (O(M)), and then use the map for accessing each distance when needed (O(1)). Total order of the solution that way would be O(N+M).
Well, this does not seem to return the correct number.. The tests are all messed up anyway
Well, people may find out automatic boxing/unboxing ;) that may be useful.
As others have mentioned, the Java test cases switch expected and actual output.
For Java, the starter method returns a Boolean instead of a boolean. Not a big deal, but unneccesary.
What is the advangage of using String.format over regular concatenation?
How do you get the fitness in the Java implementation? I've completed everything else.
Edit: https://docs.oracle.com/javase/8/docs/api/java/util/function/ToDoubleFunction.html
Exactly. It shouldn't pass. But it is allowed in some solutions I'm seeing. That would help people to achieve the right solution.
Marked as resolved.
Test with "a.b" doesn't pass.
Nope. It's still not resolved. You need to make a new reply and mark the checkbox below the comment box.
Loading more items...